
<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>pymatgen.analysis.chemenv.coordination_environments.coordination_geometries &#8212; pymatgen 2020.7.3 documentation</title>
    <link rel="stylesheet" href="../../../../../_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="../../../../../" src="../../../../../_static/documentation_options.js"></script>
    <script src="../../../../../_static/jquery.js"></script>
    <script src="../../../../../_static/underscore.js"></script>
    <script src="../../../../../_static/doctools.js"></script>
    <script src="../../../../../_static/language_data.js"></script>
    <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <link rel="index" title="Index" href="../../../../../genindex.html" />
    <link rel="search" title="Search" href="../../../../../search.html" />
 
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-33990148-1']);
  _gaq.push(['_trackPageview']);
</script>

  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../../../index.html">pymatgen 2020.7.3 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../../index.html" >Module code</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../../../../pymatgen.html" accesskey="U">pymatgen</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">pymatgen.analysis.chemenv.coordination_environments.coordination_geometries</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
          <div class="body" role="main">
            
  <h1>Source code for pymatgen.analysis.chemenv.coordination_environments.coordination_geometries</h1><div class="highlight"><pre>
<span></span><span class="c1"># coding: utf-8</span>
<span class="c1"># Copyright (c) Pymatgen Development Team.</span>
<span class="c1"># Distributed under the terms of the MIT License.</span>


<span class="sd">&quot;&quot;&quot;</span>
<span class="sd">This module contains the class describing the coordination geometries that can exist in a given structure. These</span>
<span class="sd">&quot;model&quot; coordination geometries are described in the following articles :</span>
<span class="sd"> - Pure Appl. Chem., Vol. 79, No. 10, pp. 1779--1799, 2007.</span>
<span class="sd"> - Acta Cryst. A, Vol. 46, No. 1, pp. 1--11, 1990.</span>
<span class="sd">The module also contains descriptors of part of these geometries (plane of separation, ...) that are used in the</span>
<span class="sd">identification algorithms.</span>
<span class="sd">&quot;&quot;&quot;</span>

<span class="n">__author__</span> <span class="o">=</span> <span class="s2">&quot;David Waroquiers&quot;</span>
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s2">&quot;Copyright 2012, The Materials Project&quot;</span>
<span class="n">__credits__</span> <span class="o">=</span> <span class="s2">&quot;Geoffroy Hautier&quot;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;2.0&quot;</span>
<span class="n">__maintainer__</span> <span class="o">=</span> <span class="s2">&quot;David Waroquiers&quot;</span>
<span class="n">__email__</span> <span class="o">=</span> <span class="s2">&quot;david.waroquiers@gmail.com&quot;</span>
<span class="n">__date__</span> <span class="o">=</span> <span class="s2">&quot;Feb 20, 2016&quot;</span>

<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">from</span> <span class="nn">scipy.special</span> <span class="kn">import</span> <span class="n">factorial</span>
<span class="kn">import</span> <span class="nn">itertools</span>
<span class="kn">import</span> <span class="nn">abc</span>
<span class="kn">from</span> <span class="nn">monty.json</span> <span class="kn">import</span> <span class="n">MSONable</span><span class="p">,</span> <span class="n">MontyDecoder</span>
<span class="kn">import</span> <span class="nn">json</span>
<span class="kn">import</span> <span class="nn">os</span>

<span class="n">module_dir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="vm">__file__</span><span class="p">))</span>

<span class="n">UNKNOWN_ENVIRONMENT_SYMBOL</span> <span class="o">=</span> <span class="s1">&#39;UNKNOWN&#39;</span>
<span class="n">UNCLEAR_ENVIRONMENT_SYMBOL</span> <span class="o">=</span> <span class="s1">&#39;UNCLEAR&#39;</span>
<span class="n">EXPLICIT_PERMUTATIONS</span> <span class="o">=</span> <span class="s1">&#39;EXPLICIT_PERMUTATIONS&#39;</span>
<span class="n">SEPARATION_PLANE</span> <span class="o">=</span> <span class="s1">&#39;SEPARATION_PLANE&#39;</span>


<div class="viewcode-block" id="AbstractChemenvAlgorithm"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AbstractChemenvAlgorithm">[docs]</a><span class="k">class</span> <span class="nc">AbstractChemenvAlgorithm</span><span class="p">(</span><span class="n">MSONable</span><span class="p">,</span> <span class="n">metaclass</span><span class="o">=</span><span class="n">abc</span><span class="o">.</span><span class="n">ABCMeta</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">    Base class used to define a Chemenv algorithm used to identify the correct permutation for the computation</span>
<span class="sd">    of the Continuous Symmetry Measure.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">algorithm_type</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Base constructor for ChemenvAlgorithm.</span>

<span class="sd">        Args:</span>
<span class="sd">            algorithm_type (str): Type of algorithm.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_algorithm_type</span> <span class="o">=</span> <span class="n">algorithm_type</span>

<div class="viewcode-block" id="AbstractChemenvAlgorithm.as_dict"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AbstractChemenvAlgorithm.as_dict">[docs]</a>    <span class="nd">@abc</span><span class="o">.</span><span class="n">abstractmethod</span>
    <span class="k">def</span> <span class="nf">as_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        A JSON serializable dict representation of the algorithm</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">pass</span></div>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">algorithm_type</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Return the type of algorithm.</span>

<span class="sd">        Returns: Type of the algorithm</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_algorithm_type</span>

    <span class="nd">@abc</span><span class="o">.</span><span class="n">abstractmethod</span>
    <span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span></div>


<div class="viewcode-block" id="ExplicitPermutationsAlgorithm"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.ExplicitPermutationsAlgorithm">[docs]</a><span class="k">class</span> <span class="nc">ExplicitPermutationsAlgorithm</span><span class="p">(</span><span class="n">AbstractChemenvAlgorithm</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">    Class representing the algorithm doing the explicit permutations for the calculation of</span>
<span class="sd">    the Continuous Symmetry Measure.</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">permutations</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">            Initializes a separation plane for a given perfect coordination geometry.</span>

<span class="sd">        Args:</span>
<span class="sd">            permutations: Permutations used for this algorithm.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span>
            <span class="n">algorithm_type</span><span class="o">=</span><span class="n">EXPLICIT_PERMUTATIONS</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_permutations</span> <span class="o">=</span> <span class="n">permutations</span>

    <span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">algorithm_type</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">permutations</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Return the permutations to be performed for this algorithm.</span>

<span class="sd">        Returns: Permutations to be performed.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_permutations</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">as_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Return the JSON serializable dict representation of this ExplicitPermutationsAlgorithm algorithm.</span>

<span class="sd">        Returns: a JSON serializable dict representation of this ExplicitPermutationsAlgorithm algorithm.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="p">{</span><span class="s2">&quot;@module&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__module__</span><span class="p">,</span>
                <span class="s2">&quot;@class&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="p">,</span>
                <span class="s2">&quot;permutations&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_permutations</span><span class="p">}</span>

<div class="viewcode-block" id="ExplicitPermutationsAlgorithm.from_dict"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.ExplicitPermutationsAlgorithm.from_dict">[docs]</a>    <span class="nd">@classmethod</span>
    <span class="k">def</span> <span class="nf">from_dict</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">dd</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Reconstructs the ExplicitPermutationsAlgorithm algorithm from its JSON serializable dict representation.</span>

<span class="sd">        Args:</span>
<span class="sd">            dd: a JSON serializable dict representation of an ExplicitPermutationsAlgorithm algorithm.</span>

<span class="sd">        Returns: an ExplicitPermutationsAlgorithm algorithm.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;permutations&#39;</span><span class="p">])</span></div></div>


<div class="viewcode-block" id="SeparationPlane"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.SeparationPlane">[docs]</a><span class="k">class</span> <span class="nc">SeparationPlane</span><span class="p">(</span><span class="n">AbstractChemenvAlgorithm</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">    Class representing the algorithm using separation planes for the calculation of</span>
<span class="sd">    the Continuous Symmetry Measure.</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">plane_points</span><span class="p">,</span> <span class="n">mirror_plane</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">ordered_plane</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
                 <span class="n">point_groups</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                 <span class="n">ordered_point_groups</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>  <span class="c1"># include_inverted_plane=False,</span>
                 <span class="c1"># do_inverse_pt_gp_permutations=False, plane_type=&#39;MIRROR&#39;,</span>
                 <span class="n">explicit_permutations</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">minimum_number_of_points</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                 <span class="n">explicit_optimized_permutations</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                 <span class="n">multiplicity</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                 <span class="n">other_plane_points</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>  <span class="c1"># , plane_safe_permutations=False):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">            Initializes a separation plane for a given perfect coordination geometry</span>

<span class="sd">        Args:</span>
<span class="sd">            plane_points: Indices of the points that are in the plane in the perfect structure (and should be</span>
<span class="sd">                found in the defective one as well).</span>
<span class="sd">            mirror_plane: True if the separation plane is a mirror plane, in which case there is a correspondence</span>
<span class="sd">                of the points in each point_group (can reduce the number of permutations).</span>
<span class="sd">            ordered_plane: True if the order of the points in the plane can be taken into account to reduce the</span>
<span class="sd">                number of permutations.</span>
<span class="sd">            point_groups: Indices of the points in the two groups of points separated by the plane.</span>
<span class="sd">            ordered_point_groups: Whether the order of the points in each group of points can be taken into account to</span>
<span class="sd">                reduce the number of permutations.</span>
<span class="sd">            explicit_permutations: Explicit permutations to be performed in this separation plane algorithm.</span>
<span class="sd">            minimum_number_of_points: Minimum number of points needed to initialize a separation plane</span>
<span class="sd">                for this algorithm.</span>
<span class="sd">            explicit_optimized_permutations: Optimized set of explicit permutations to be performed in this</span>
<span class="sd">                separation plane algorithm.</span>
<span class="sd">            multiplicity: Number of such planes in the model geometry.</span>
<span class="sd">            other_plane_points: Indices of the points that are in the plane in the perfect structure for the other</span>
<span class="sd">                planes. The multiplicity should be equal to the length of this list + 1 (&quot;main&quot; separation plane +</span>
<span class="sd">                the other ones).</span>
<span class="sd">            &quot;&quot;&quot;</span>
        <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">algorithm_type</span><span class="o">=</span><span class="n">SEPARATION_PLANE</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">mirror_plane</span> <span class="o">=</span> <span class="n">mirror_plane</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">plane_points</span> <span class="o">=</span> <span class="n">plane_points</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">point_groups</span> <span class="o">=</span> <span class="n">point_groups</span>
        <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">1</span><span class="p">]):</span>
            <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span>
                <span class="s2">&quot;The number of points in the first group should be</span><span class="se">\n</span><span class="s2">&quot;</span>
                <span class="s2">&quot;less than or equal to the number of points in the second group&quot;</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_hash</span> <span class="o">=</span> <span class="mi">10000</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="n">plane_points</span><span class="p">)</span> <span class="o">+</span> <span class="mi">100</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span>
            <span class="n">point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">+</span> <span class="nb">len</span><span class="p">(</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">ordered_plane</span> <span class="o">=</span> <span class="n">ordered_plane</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">ordered_point_groups</span> <span class="o">=</span> <span class="p">[</span><span class="kc">False</span><span class="p">,</span>
                                     <span class="kc">False</span><span class="p">]</span> <span class="k">if</span> <span class="n">ordered_point_groups</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">ordered_point_groups</span>
        <span class="c1"># self._ordered_indices = list(point_groups[0])</span>
        <span class="c1"># self._ordered_indices.extend(plane_points)</span>
        <span class="c1"># self._ordered_indices.extend(point_groups[1])</span>
        <span class="c1"># self._inv_ordered_indices = np.argsort(self._ordered_indices)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">explicit_permutations</span> <span class="o">=</span> <span class="n">explicit_permutations</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">explicit_optimized_permutations</span> <span class="o">=</span> <span class="n">explicit_optimized_permutations</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_safe_permutations</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">explicit_optimized_permutations</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_permutations</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">explicit_optimized_permutations</span>
        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">explicit_permutations</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_permutations</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">explicit_permutations</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">multiplicity</span> <span class="o">=</span> <span class="n">multiplicity</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">other_plane_points</span> <span class="o">=</span> <span class="n">other_plane_points</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">minimum_number_of_points</span> <span class="o">=</span> <span class="n">minimum_number_of_points</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">maximum_number_of_points</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plane_points</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_ref_separation_perm</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_ref_separation_perm</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plane_points</span><span class="p">))</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_ref_separation_perm</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_argsorted_ref_separation_perm</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span>
            <span class="n">np</span><span class="o">.</span><span class="n">argsort</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_ref_separation_perm</span><span class="p">))</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">separation</span> <span class="o">=</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span> <span class="nb">len</span><span class="p">(</span><span class="n">plane_points</span><span class="p">),</span> <span class="nb">len</span><span class="p">(</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>

    <span class="c1"># @property</span>
    <span class="c1"># def ordered_indices(self):</span>
    <span class="c1">#     &quot;&quot;&quot;</span>
    <span class="c1">#     Ordered indices of the separation plane.</span>
    <span class="c1">#</span>
    <span class="c1">#     Examples:</span>
    <span class="c1">#          For a separation plane of type 2|4|3, with plane_points indices [0, 3, 5, 8] and</span>
    <span class="c1">#          point_groups indices [1, 4] and [2, 7, 6], the list of ordered indices is :</span>
    <span class="c1">#          [0, 3, 5, 8, 1, 4, 2, 7, 6].</span>
    <span class="c1">#</span>
    <span class="c1">#     Returns: list of ordered indices of this separation plane.</span>
    <span class="c1">#     &quot;&quot;&quot;</span>
    <span class="c1">#     return self._ordered_indices</span>
    <span class="c1">#</span>
    <span class="c1"># @property</span>
    <span class="c1"># def inv_ordered_indices(self):</span>
    <span class="c1">#     return self._inv_ordered_indices</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">permutations</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Permutations used for this separation plane algorithm.</span>

<span class="sd">        Returns: List of permutations to be performed.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_permutations</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">ref_separation_perm</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Ordered indices of the separation plane.</span>

<span class="sd">        Examples:</span>
<span class="sd">             For a separation plane of type 2|4|3, with plane_points indices [0, 3, 5, 8] and</span>
<span class="sd">             point_groups indices [1, 4] and [2, 7, 6], the list of ordered indices is :</span>
<span class="sd">             [0, 3, 5, 8, 1, 4, 2, 7, 6].</span>

<span class="sd">        Returns: list of ordered indices of this separation plane.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_ref_separation_perm</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">argsorted_ref_separation_perm</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        &quot;Arg sorted&quot; ordered indices of the separation plane.</span>

<span class="sd">        This is used in the identification of the final permutation to be used.</span>

<span class="sd">        Returns: list of the &quot;arg sorted&quot; ordered indices of the separation plane.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_argsorted_ref_separation_perm</span>

<div class="viewcode-block" id="SeparationPlane.safe_separation_permutations"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.SeparationPlane.safe_separation_permutations">[docs]</a>    <span class="k">def</span> <span class="nf">safe_separation_permutations</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ordered_plane</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
                                     <span class="n">ordered_point_groups</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                                     <span class="n">add_opposite</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Simple and safe permutations for this separation plane.</span>

<span class="sd">        This is not meant to be used in production. Default configuration for ChemEnv does not use this method.</span>
<span class="sd">        Args:</span>
<span class="sd">            ordered_plane: Whether the order of the points in the plane can be used to reduce the</span>
<span class="sd">                number of permutations.</span>
<span class="sd">            ordered_point_groups: Whether the order of the points in each point group can be used to reduce the</span>
<span class="sd">                number of permutations.</span>
<span class="sd">            add_opposite: Whether to add the permutations from the second group before the first group as well.</span>

<span class="sd">        Returns: List of safe permutations.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">s0</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">])))</span>
        <span class="n">plane</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span>
                           <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">+</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plane_points</span><span class="p">)))</span>
        <span class="n">s1</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">+</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plane_points</span><span class="p">),</span>
                        <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">+</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plane_points</span><span class="p">)</span> <span class="o">+</span> <span class="nb">len</span><span class="p">(</span>
                            <span class="bp">self</span><span class="o">.</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">1</span><span class="p">])))</span>
        <span class="n">ordered_point_groups</span> <span class="o">=</span> <span class="p">[</span><span class="kc">False</span><span class="p">,</span>
                                <span class="kc">False</span><span class="p">]</span> <span class="k">if</span> <span class="n">ordered_point_groups</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">ordered_point_groups</span>

        <span class="k">def</span> <span class="nf">rotate</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
            <span class="k">return</span> <span class="n">s</span><span class="p">[</span><span class="o">-</span><span class="n">n</span><span class="p">:]</span> <span class="o">+</span> <span class="n">s</span><span class="p">[:</span><span class="o">-</span><span class="n">n</span><span class="p">]</span>
        <span class="k">if</span> <span class="n">ordered_plane</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">ordered_plane</span><span class="p">:</span>
            <span class="n">plane_perms</span> <span class="o">=</span> <span class="p">[</span><span class="n">rotate</span><span class="p">(</span><span class="n">plane</span><span class="p">,</span> <span class="n">ii</span><span class="p">)</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">plane</span><span class="p">))]</span>
            <span class="n">inv_plane</span> <span class="o">=</span> <span class="n">plane</span><span class="p">[::</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
            <span class="n">plane_perms</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span>
                <span class="p">[</span><span class="n">rotate</span><span class="p">(</span><span class="n">inv_plane</span><span class="p">,</span> <span class="n">ii</span><span class="p">)</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">inv_plane</span><span class="p">))])</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">plane_perms</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">itertools</span><span class="o">.</span><span class="n">permutations</span><span class="p">(</span><span class="n">plane</span><span class="p">))</span>
        <span class="k">if</span> <span class="n">ordered_point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">ordered_point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">]:</span>
            <span class="n">s0_perms</span> <span class="o">=</span> <span class="p">[</span><span class="n">rotate</span><span class="p">(</span><span class="n">s0</span><span class="p">,</span> <span class="n">ii</span><span class="p">)</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">s0</span><span class="p">))]</span>
            <span class="n">inv_s0</span> <span class="o">=</span> <span class="n">s0</span><span class="p">[::</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
            <span class="n">s0_perms</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="n">rotate</span><span class="p">(</span><span class="n">inv_s0</span><span class="p">,</span> <span class="n">ii</span><span class="p">)</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">inv_s0</span><span class="p">))])</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">s0_perms</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">itertools</span><span class="o">.</span><span class="n">permutations</span><span class="p">(</span><span class="n">s0</span><span class="p">))</span>
        <span class="k">if</span> <span class="n">ordered_point_groups</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">ordered_point_groups</span><span class="p">[</span><span class="mi">1</span><span class="p">]:</span>
            <span class="n">s1_perms</span> <span class="o">=</span> <span class="p">[</span><span class="n">rotate</span><span class="p">(</span><span class="n">s1</span><span class="p">,</span> <span class="n">ii</span><span class="p">)</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">s1</span><span class="p">))]</span>
            <span class="n">inv_s1</span> <span class="o">=</span> <span class="n">s1</span><span class="p">[::</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
            <span class="n">s1_perms</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="n">rotate</span><span class="p">(</span><span class="n">inv_s1</span><span class="p">,</span> <span class="n">ii</span><span class="p">)</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">inv_s1</span><span class="p">))])</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">s1_perms</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">itertools</span><span class="o">.</span><span class="n">permutations</span><span class="p">(</span><span class="n">s1</span><span class="p">))</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_safe_permutations</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_safe_permutations</span> <span class="o">=</span> <span class="p">[]</span>
            <span class="k">for</span> <span class="n">perm_side1</span> <span class="ow">in</span> <span class="n">s0_perms</span><span class="p">:</span>
                <span class="k">for</span> <span class="n">perm_sep_plane</span> <span class="ow">in</span> <span class="n">plane_perms</span><span class="p">:</span>
                    <span class="k">for</span> <span class="n">perm_side2</span> <span class="ow">in</span> <span class="n">s1_perms</span><span class="p">:</span>
                        <span class="n">perm</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">perm_side1</span><span class="p">)</span>
                        <span class="n">perm</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">perm_sep_plane</span><span class="p">))</span>
                        <span class="n">perm</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">perm_side2</span><span class="p">))</span>
                        <span class="bp">self</span><span class="o">.</span><span class="n">_safe_permutations</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">perm</span><span class="p">)</span>
                        <span class="k">if</span> <span class="n">add_opposite</span><span class="p">:</span>
                            <span class="n">perm</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">perm_side2</span><span class="p">)</span>
                            <span class="n">perm</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">perm_sep_plane</span><span class="p">))</span>
                            <span class="n">perm</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">perm_side1</span><span class="p">))</span>
                            <span class="bp">self</span><span class="o">.</span><span class="n">_safe_permutations</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">perm</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_safe_permutations</span></div>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">as_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Return the JSON serializable dict representation of this SeparationPlane algorithm.</span>

<span class="sd">        Returns: a JSON serializable dict representation of this SeparationPlane algorithm.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="p">{</span><span class="s2">&quot;@module&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__module__</span><span class="p">,</span>
                <span class="s2">&quot;@class&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="p">,</span>
                <span class="s2">&quot;plane_points&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">plane_points</span><span class="p">,</span>
                <span class="s2">&quot;mirror_plane&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mirror_plane</span><span class="p">,</span>
                <span class="s2">&quot;ordered_plane&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">ordered_plane</span><span class="p">,</span>
                <span class="s2">&quot;point_groups&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">point_groups</span><span class="p">,</span>
                <span class="s2">&quot;ordered_point_groups&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">ordered_point_groups</span><span class="p">,</span>
                <span class="s2">&quot;explicit_permutations&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">eperm</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> <span class="k">for</span> <span class="n">eperm</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">explicit_permutations</span><span class="p">]</span>
                <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">explicit_permutations</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
                <span class="s2">&quot;explicit_optimized_permutations&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">eoperm</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span>
                                                    <span class="k">for</span> <span class="n">eoperm</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">explicit_optimized_permutations</span><span class="p">]</span>
                <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">explicit_optimized_permutations</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
                <span class="s2">&quot;multiplicity&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">multiplicity</span><span class="p">,</span>
                <span class="s2">&quot;other_plane_points&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">other_plane_points</span><span class="p">,</span>
                <span class="s2">&quot;minimum_number_of_points&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">minimum_number_of_points</span><span class="p">}</span>

<div class="viewcode-block" id="SeparationPlane.from_dict"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.SeparationPlane.from_dict">[docs]</a>    <span class="nd">@classmethod</span>
    <span class="k">def</span> <span class="nf">from_dict</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">dd</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Reconstructs the SeparationPlane algorithm from its JSON serializable dict representation.</span>

<span class="sd">        Args:</span>
<span class="sd">            dd: a JSON serializable dict representation of an SeparationPlane algorithm.</span>

<span class="sd">        Returns: a SeparationPlane algorithm.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">eop</span> <span class="o">=</span> <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">eoperm</span><span class="p">)</span> <span class="k">for</span> <span class="n">eoperm</span> <span class="ow">in</span> <span class="n">dd</span><span class="p">[</span>
            <span class="s1">&#39;explicit_optimized_permutations&#39;</span><span class="p">]]</span> <span class="k">if</span> <span class="p">(</span><span class="s1">&#39;explicit_optimized_permutations&#39;</span> <span class="ow">in</span> <span class="n">dd</span> <span class="ow">and</span>
                                                    <span class="n">dd</span><span class="p">[</span><span class="s1">&#39;explicit_optimized_permutations&#39;</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">)</span> <span class="k">else</span> <span class="kc">None</span>
        <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">plane_points</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;plane_points&#39;</span><span class="p">],</span>
                   <span class="n">mirror_plane</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;mirror_plane&#39;</span><span class="p">],</span>
                   <span class="n">ordered_plane</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;ordered_plane&#39;</span><span class="p">],</span>
                   <span class="n">point_groups</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;point_groups&#39;</span><span class="p">],</span>
                   <span class="n">ordered_point_groups</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;ordered_point_groups&#39;</span><span class="p">],</span>
                   <span class="n">explicit_permutations</span><span class="o">=</span><span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">eperm</span><span class="p">)</span> <span class="k">for</span> <span class="n">eperm</span> <span class="ow">in</span> <span class="n">dd</span><span class="p">[</span><span class="s1">&#39;explicit_permutations&#39;</span><span class="p">]],</span>
                   <span class="n">explicit_optimized_permutations</span><span class="o">=</span><span class="n">eop</span><span class="p">,</span>
                   <span class="n">multiplicity</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span>
                       <span class="s1">&#39;multiplicity&#39;</span><span class="p">]</span> <span class="k">if</span> <span class="s1">&#39;multiplicity&#39;</span> <span class="ow">in</span> <span class="n">dd</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
                   <span class="n">other_plane_points</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span>
                       <span class="s1">&#39;other_plane_points&#39;</span><span class="p">]</span> <span class="k">if</span> <span class="s1">&#39;other_plane_points&#39;</span> <span class="ow">in</span> <span class="n">dd</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
                   <span class="n">minimum_number_of_points</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;minimum_number_of_points&#39;</span><span class="p">])</span></div>

    <span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="n">out</span> <span class="o">=</span> <span class="s1">&#39;Separation plane algorithm with the following reference separation :</span><span class="se">\n</span><span class="s1">&#39;</span>
        <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;[</span><span class="si">{}</span><span class="s1">] | [</span><span class="si">{}</span><span class="s1">] | [</span><span class="si">{}</span><span class="s1">]&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
            <span class="s1">&#39;-&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">pp</span><span class="p">)</span> <span class="k">for</span> <span class="n">pp</span> <span class="ow">in</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">]]),</span>
            <span class="s1">&#39;-&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">pp</span><span class="p">)</span> <span class="k">for</span> <span class="n">pp</span> <span class="ow">in</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">plane_points</span><span class="p">]),</span>
            <span class="s1">&#39;-&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">pp</span><span class="p">)</span> <span class="k">for</span> <span class="n">pp</span> <span class="ow">in</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">1</span><span class="p">]]),</span>
        <span class="p">)</span>
        <span class="k">return</span> <span class="n">out</span></div>


<div class="viewcode-block" id="CoordinationGeometry"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry">[docs]</a><span class="k">class</span> <span class="nc">CoordinationGeometry</span><span class="p">:</span>
    <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">    Class used to store the ideal representation of a chemical environment or &quot;coordination geometry&quot;.</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="c1"># Default value of continuous symmetry measure beyond which no further</span>
    <span class="c1"># search is performed for the separation plane algorithms</span>
    <span class="n">CSM_SKIP_SEPARATION_PLANE_ALGO</span> <span class="o">=</span> <span class="mf">10.0</span>

<div class="viewcode-block" id="CoordinationGeometry.NeighborsSetsHints"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.NeighborsSetsHints">[docs]</a>    <span class="k">class</span> <span class="nc">NeighborsSetsHints</span><span class="p">:</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Class used to describe neighbors sets hints.</span>

<span class="sd">        This allows to possibly get a lower coordination from a capped-like model polyhedron.</span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="n">ALLOWED_HINTS_TYPES</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;single_cap&#39;</span><span class="p">,</span> <span class="s1">&#39;double_cap&#39;</span><span class="p">,</span> <span class="s1">&#39;triple_cap&#39;</span><span class="p">]</span>

        <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hints_type</span><span class="p">,</span> <span class="n">options</span><span class="p">):</span>
            <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">            Constructor for this NeighborsSetsHints.</span>

<span class="sd">            Args:</span>
<span class="sd">                hints_type: type of hint (single, double or triple cap)</span>
<span class="sd">                options: options for the &quot;hinting&quot;, e.g. the maximum csm value beyond which no additional</span>
<span class="sd">                    neighbors set could be found from a &quot;cap hint&quot;.</span>
<span class="sd">            &quot;&quot;&quot;</span>
            <span class="k">if</span> <span class="n">hints_type</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">ALLOWED_HINTS_TYPES</span><span class="p">:</span>
                <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Type &quot;</span><span class="si">{}</span><span class="s1">&quot; for NeighborsSetsHints is not allowed&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">type</span><span class="p">))</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">hints_type</span> <span class="o">=</span> <span class="n">hints_type</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="o">=</span> <span class="n">options</span>

<div class="viewcode-block" id="CoordinationGeometry.NeighborsSetsHints.hints"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.NeighborsSetsHints.hints">[docs]</a>        <span class="k">def</span> <span class="nf">hints</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hints_info</span><span class="p">):</span>
            <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">            Return hints for an additional neighbors set, i.e. the voronoi indices that constitute this new</span>
<span class="sd">            neighbors set.</span>

<span class="sd">            Args:</span>
<span class="sd">                hints_info: Info needed to build new &quot;hinted&quot; neighbors set.</span>

<span class="sd">            Returns: Voronoi indices of the new &quot;hinted&quot; neighbors set.</span>
<span class="sd">            &quot;&quot;&quot;</span>
            <span class="k">if</span> <span class="n">hints_info</span><span class="p">[</span><span class="s1">&#39;csm&#39;</span><span class="p">]</span> <span class="o">&gt;</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">[</span><span class="s1">&#39;csm_max&#39;</span><span class="p">]:</span>
                <span class="k">return</span> <span class="p">[]</span>
            <span class="k">return</span> <span class="nb">object</span><span class="o">.</span><span class="fm">__getattribute__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s1">&#39;</span><span class="si">{}</span><span class="s1">_hints&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">hints_type</span><span class="p">))(</span><span class="n">hints_info</span><span class="p">)</span></div>

<div class="viewcode-block" id="CoordinationGeometry.NeighborsSetsHints.single_cap_hints"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.NeighborsSetsHints.single_cap_hints">[docs]</a>        <span class="k">def</span> <span class="nf">single_cap_hints</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hints_info</span><span class="p">):</span>
            <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">            Return hints for an additional neighbors set, i.e. the voronoi indices that constitute this new</span>
<span class="sd">            neighbors set, in case of a &quot;Single cap&quot; hint.</span>

<span class="sd">            Args:</span>
<span class="sd">                hints_info: Info needed to build new &quot;hinted&quot; neighbors set.</span>

<span class="sd">            Returns: Voronoi indices of the new &quot;hinted&quot; neighbors set.</span>
<span class="sd">            &quot;&quot;&quot;</span>
            <span class="n">cap_index_perfect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">[</span><span class="s1">&#39;cap_index&#39;</span><span class="p">]</span>
            <span class="n">nb_set</span> <span class="o">=</span> <span class="n">hints_info</span><span class="p">[</span><span class="s1">&#39;nb_set&#39;</span><span class="p">]</span>
            <span class="n">permutation</span> <span class="o">=</span> <span class="n">hints_info</span><span class="p">[</span><span class="s1">&#39;permutation&#39;</span><span class="p">]</span>
            <span class="n">nb_set_voronoi_indices_perfect_aligned</span> <span class="o">=</span> <span class="n">nb_set</span><span class="o">.</span><span class="n">get_neighb_voronoi_indices</span><span class="p">(</span><span class="n">permutation</span><span class="o">=</span><span class="n">permutation</span><span class="p">)</span>
            <span class="n">cap_voronoi_index</span> <span class="o">=</span> <span class="n">nb_set_voronoi_indices_perfect_aligned</span><span class="p">[</span><span class="n">cap_index_perfect</span><span class="p">]</span>
            <span class="n">new_site_voronoi_indices</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">nb_set</span><span class="o">.</span><span class="n">site_voronoi_indices</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">cap_voronoi_index</span><span class="p">)</span>
            <span class="k">return</span> <span class="p">[</span><span class="n">new_site_voronoi_indices</span><span class="p">]</span></div>

<div class="viewcode-block" id="CoordinationGeometry.NeighborsSetsHints.double_cap_hints"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.NeighborsSetsHints.double_cap_hints">[docs]</a>        <span class="k">def</span> <span class="nf">double_cap_hints</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hints_info</span><span class="p">):</span>
            <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">            Return hints for an additional neighbors set, i.e. the voronoi indices that constitute this new</span>
<span class="sd">            neighbors set, in case of a &quot;Double cap&quot; hint.</span>

<span class="sd">            Args:</span>
<span class="sd">                hints_info: Info needed to build new &quot;hinted&quot; neighbors set.</span>

<span class="sd">            Returns: Voronoi indices of the new &quot;hinted&quot; neighbors set.</span>
<span class="sd">            &quot;&quot;&quot;</span>
            <span class="n">first_cap_index_perfect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">[</span><span class="s1">&#39;first_cap_index&#39;</span><span class="p">]</span>
            <span class="n">second_cap_index_perfect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">[</span><span class="s1">&#39;second_cap_index&#39;</span><span class="p">]</span>
            <span class="n">nb_set</span> <span class="o">=</span> <span class="n">hints_info</span><span class="p">[</span><span class="s1">&#39;nb_set&#39;</span><span class="p">]</span>
            <span class="n">permutation</span> <span class="o">=</span> <span class="n">hints_info</span><span class="p">[</span><span class="s1">&#39;permutation&#39;</span><span class="p">]</span>
            <span class="n">nb_set_voronoi_indices_perfect_aligned</span> <span class="o">=</span> <span class="n">nb_set</span><span class="o">.</span><span class="n">get_neighb_voronoi_indices</span><span class="p">(</span><span class="n">permutation</span><span class="o">=</span><span class="n">permutation</span><span class="p">)</span>
            <span class="n">first_cap_voronoi_index</span> <span class="o">=</span> <span class="n">nb_set_voronoi_indices_perfect_aligned</span><span class="p">[</span><span class="n">first_cap_index_perfect</span><span class="p">]</span>
            <span class="n">second_cap_voronoi_index</span> <span class="o">=</span> <span class="n">nb_set_voronoi_indices_perfect_aligned</span><span class="p">[</span><span class="n">second_cap_index_perfect</span><span class="p">]</span>
            <span class="n">new_site_voronoi_indices1</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">nb_set</span><span class="o">.</span><span class="n">site_voronoi_indices</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices2</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">nb_set</span><span class="o">.</span><span class="n">site_voronoi_indices</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices3</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">nb_set</span><span class="o">.</span><span class="n">site_voronoi_indices</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices1</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">first_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices2</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">second_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices3</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">first_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices3</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">second_cap_voronoi_index</span><span class="p">)</span>
            <span class="k">return</span> <span class="p">[</span><span class="n">new_site_voronoi_indices1</span><span class="p">,</span> <span class="n">new_site_voronoi_indices2</span><span class="p">,</span> <span class="n">new_site_voronoi_indices3</span><span class="p">]</span></div>

<div class="viewcode-block" id="CoordinationGeometry.NeighborsSetsHints.triple_cap_hints"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.NeighborsSetsHints.triple_cap_hints">[docs]</a>        <span class="k">def</span> <span class="nf">triple_cap_hints</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hints_info</span><span class="p">):</span>
            <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">            Return hints for an additional neighbors set, i.e. the voronoi indices that constitute this new</span>
<span class="sd">            neighbors set, in case of a &quot;Triple cap&quot; hint.</span>

<span class="sd">            Args:</span>
<span class="sd">                hints_info: Info needed to build new &quot;hinted&quot; neighbors set.</span>

<span class="sd">            Returns: Voronoi indices of the new &quot;hinted&quot; neighbors set.</span>
<span class="sd">            &quot;&quot;&quot;</span>
            <span class="n">first_cap_index_perfect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">[</span><span class="s1">&#39;first_cap_index&#39;</span><span class="p">]</span>
            <span class="n">second_cap_index_perfect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">[</span><span class="s1">&#39;second_cap_index&#39;</span><span class="p">]</span>
            <span class="n">third_cap_index_perfect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">[</span><span class="s1">&#39;third_cap_index&#39;</span><span class="p">]</span>
            <span class="n">nb_set</span> <span class="o">=</span> <span class="n">hints_info</span><span class="p">[</span><span class="s1">&#39;nb_set&#39;</span><span class="p">]</span>
            <span class="n">permutation</span> <span class="o">=</span> <span class="n">hints_info</span><span class="p">[</span><span class="s1">&#39;permutation&#39;</span><span class="p">]</span>
            <span class="n">nb_set_voronoi_indices_perfect_aligned</span> <span class="o">=</span> <span class="n">nb_set</span><span class="o">.</span><span class="n">get_neighb_voronoi_indices</span><span class="p">(</span><span class="n">permutation</span><span class="o">=</span><span class="n">permutation</span><span class="p">)</span>
            <span class="n">first_cap_voronoi_index</span> <span class="o">=</span> <span class="n">nb_set_voronoi_indices_perfect_aligned</span><span class="p">[</span><span class="n">first_cap_index_perfect</span><span class="p">]</span>
            <span class="n">second_cap_voronoi_index</span> <span class="o">=</span> <span class="n">nb_set_voronoi_indices_perfect_aligned</span><span class="p">[</span><span class="n">second_cap_index_perfect</span><span class="p">]</span>
            <span class="n">third_cap_voronoi_index</span> <span class="o">=</span> <span class="n">nb_set_voronoi_indices_perfect_aligned</span><span class="p">[</span><span class="n">third_cap_index_perfect</span><span class="p">]</span>
            <span class="n">new_site_voronoi_indices1</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">nb_set</span><span class="o">.</span><span class="n">site_voronoi_indices</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices2</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">nb_set</span><span class="o">.</span><span class="n">site_voronoi_indices</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices3</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">nb_set</span><span class="o">.</span><span class="n">site_voronoi_indices</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices4</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">nb_set</span><span class="o">.</span><span class="n">site_voronoi_indices</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices5</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">nb_set</span><span class="o">.</span><span class="n">site_voronoi_indices</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices6</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">nb_set</span><span class="o">.</span><span class="n">site_voronoi_indices</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices7</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">nb_set</span><span class="o">.</span><span class="n">site_voronoi_indices</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices1</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">first_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices2</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">second_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices3</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">third_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices4</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">second_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices4</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">third_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices5</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">first_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices5</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">third_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices6</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">first_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices6</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">second_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices7</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">first_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices7</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">second_cap_voronoi_index</span><span class="p">)</span>
            <span class="n">new_site_voronoi_indices7</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">third_cap_voronoi_index</span><span class="p">)</span>
            <span class="k">return</span> <span class="p">[</span><span class="n">new_site_voronoi_indices1</span><span class="p">,</span> <span class="n">new_site_voronoi_indices2</span><span class="p">,</span> <span class="n">new_site_voronoi_indices3</span><span class="p">,</span>
                    <span class="n">new_site_voronoi_indices4</span><span class="p">,</span> <span class="n">new_site_voronoi_indices5</span><span class="p">,</span> <span class="n">new_site_voronoi_indices6</span><span class="p">,</span>
                    <span class="n">new_site_voronoi_indices7</span><span class="p">]</span></div>

<div class="viewcode-block" id="CoordinationGeometry.NeighborsSetsHints.as_dict"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.NeighborsSetsHints.as_dict">[docs]</a>        <span class="k">def</span> <span class="nf">as_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
            <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">            A JSON serializable dict representation of this NeighborsSetsHints</span>
<span class="sd">            &quot;&quot;&quot;</span>
            <span class="k">return</span> <span class="p">{</span><span class="s1">&#39;hints_type&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">hints_type</span><span class="p">,</span>
                    <span class="s1">&#39;options&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">}</span></div>

<div class="viewcode-block" id="CoordinationGeometry.NeighborsSetsHints.from_dict"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.NeighborsSetsHints.from_dict">[docs]</a>        <span class="nd">@classmethod</span>
        <span class="k">def</span> <span class="nf">from_dict</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">dd</span><span class="p">):</span>
            <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">            Reconstructs the NeighborsSetsHints from its JSON serializable dict representation.</span>

<span class="sd">            Args:</span>
<span class="sd">                dd: a JSON serializable dict representation of a NeighborsSetsHints.</span>

<span class="sd">            Returns: a NeighborsSetsHints.</span>
<span class="sd">            &quot;&quot;&quot;</span>
            <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">hints_type</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;hints_type&#39;</span><span class="p">],</span>
                       <span class="n">options</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;options&#39;</span><span class="p">])</span></div></div>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mp_symbol</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">alternative_names</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                 <span class="n">IUPAC_symbol</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">IUCr_symbol</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">coordination</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                 <span class="n">central_site</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span><span class="mi">3</span><span class="p">),</span> <span class="n">points</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">solid_angles</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                 <span class="n">permutations_safe_override</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
                 <span class="n">deactivate</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">faces</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                 <span class="n">edges</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                 <span class="n">algorithms</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                 <span class="n">equivalent_indices</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                 <span class="n">neighbors_sets_hints</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Initializes one &quot;coordination geometry&quot; according to [Pure Appl. Chem., Vol. 79, No. 10, pp. 1779--1799, 2007]</span>
<span class="sd">        and [Acta Cryst. A, Vol. 46, No. 1, pp. 1--11, 1990].</span>

<span class="sd">        Args:</span>
<span class="sd">            mp_symbol: Symbol used internally for the coordination geometry.</span>
<span class="sd">            name: Name of the coordination geometry.</span>
<span class="sd">            alternative_names: Alternative names for this coordination geometry.</span>
<span class="sd">            IUPAC_symbol: The IUPAC symbol of this coordination geometry.</span>
<span class="sd">            IUCr_symbol: The IUCr symbol of this coordination geometry.</span>
<span class="sd">            coordination: The coordination number of this coordination geometry (number of neighboring atoms).</span>
<span class="sd">            central_site: The coordinates of the central site of this coordination geometry.</span>
<span class="sd">            points: The list of the coordinates of all the points of this coordination geometry.</span>
<span class="sd">            solid_angles: The list of solid angles for each neighbor in this coordination geometry.</span>
<span class="sd">            permutations_safe_override: Computes all the permutations if set to True (overrides the plane separation</span>
<span class="sd">                algorithms or any other algorithm, for testing purposes)</span>
<span class="sd">            deactivate: Whether to deactivate this coordination geometry</span>
<span class="sd">            faces: List of the faces with their vertices given in a clockwise or anticlockwise order, for drawing</span>
<span class="sd">                purposes.</span>
<span class="sd">            edges: List of edges, for drawing purposes.</span>
<span class="sd">            algorithms: Algorithms used to identify this coordination geometry.</span>
<span class="sd">            equivalent_indices: The equivalent sets of indices in this coordination geometry (can be used to skip</span>
<span class="sd">                equivalent permutations that have already been performed).</span>
<span class="sd">            neighbors_sets_hints: Neighors sets hints for this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_mp_symbol</span> <span class="o">=</span> <span class="n">mp_symbol</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">alternative_names</span> <span class="o">=</span> <span class="n">alternative_names</span> <span class="k">if</span> <span class="n">alternative_names</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="p">[]</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">IUPACsymbol</span> <span class="o">=</span> <span class="n">IUPAC_symbol</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">IUCrsymbol</span> <span class="o">=</span> <span class="n">IUCr_symbol</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">coordination</span> <span class="o">=</span> <span class="n">coordination</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">central_site</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">central_site</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">points</span> <span class="o">=</span> <span class="n">points</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_solid_angles</span> <span class="o">=</span> <span class="n">solid_angles</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">permutations_safe_override</span> <span class="o">=</span> <span class="n">permutations_safe_override</span>
        <span class="c1"># self.plane_safe_permutations = plane_safe_permutations</span>
        <span class="c1"># self.setup_permutations(permutations)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">deactivate</span> <span class="o">=</span> <span class="n">deactivate</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_faces</span> <span class="o">=</span> <span class="n">faces</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_edges</span> <span class="o">=</span> <span class="n">edges</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_algorithms</span> <span class="o">=</span> <span class="n">algorithms</span>
        <span class="k">if</span> <span class="n">points</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">centroid</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">points</span><span class="p">),</span> <span class="n">axis</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">centroid</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">equivalent_indices</span> <span class="o">=</span> <span class="n">equivalent_indices</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">neighbors_sets_hints</span> <span class="o">=</span> <span class="n">neighbors_sets_hints</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_pauling_stability_ratio</span> <span class="o">=</span> <span class="kc">None</span>

<div class="viewcode-block" id="CoordinationGeometry.as_dict"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.as_dict">[docs]</a>    <span class="k">def</span> <span class="nf">as_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        A JSON serializable dict representation of this CoordinationGeometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="p">{</span><span class="s1">&#39;mp_symbol&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_mp_symbol</span><span class="p">,</span>
                <span class="s1">&#39;name&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
                <span class="s1">&#39;alternative_names&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">alternative_names</span><span class="p">,</span>
                <span class="s1">&#39;IUPAC_symbol&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">IUPACsymbol</span><span class="p">,</span>
                <span class="s1">&#39;IUCr_symbol&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">IUCrsymbol</span><span class="p">,</span>
                <span class="s1">&#39;coordination&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">coordination</span><span class="p">,</span>
                <span class="s1">&#39;central_site&#39;</span><span class="p">:</span> <span class="p">[</span><span class="nb">float</span><span class="p">(</span><span class="n">xx</span><span class="p">)</span> <span class="k">for</span> <span class="n">xx</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">central_site</span><span class="p">],</span>
                <span class="s1">&#39;points&#39;</span><span class="p">:</span> <span class="p">[[</span><span class="nb">float</span><span class="p">(</span><span class="n">xx</span><span class="p">)</span> <span class="k">for</span> <span class="n">xx</span> <span class="ow">in</span> <span class="n">pp</span><span class="p">]</span> <span class="k">for</span> <span class="n">pp</span> <span class="ow">in</span>
                           <span class="bp">self</span><span class="o">.</span><span class="n">points</span><span class="p">]</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">points</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
                <span class="s1">&#39;solid_angles&#39;</span><span class="p">:</span> <span class="p">[</span><span class="nb">float</span><span class="p">(</span><span class="n">ang</span><span class="p">)</span> <span class="k">for</span> <span class="n">ang</span> <span class="ow">in</span>
                                 <span class="bp">self</span><span class="o">.</span><span class="n">_solid_angles</span><span class="p">]</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_solid_angles</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
                <span class="s1">&#39;deactivate&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">deactivate</span><span class="p">,</span>
                <span class="s1">&#39;_faces&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_faces</span><span class="p">,</span>
                <span class="s1">&#39;_edges&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_edges</span><span class="p">,</span>
                <span class="s1">&#39;_algorithms&#39;</span><span class="p">:</span> <span class="p">[</span><span class="n">algo</span><span class="o">.</span><span class="n">as_dict</span> <span class="k">for</span> <span class="n">algo</span> <span class="ow">in</span>
                                <span class="bp">self</span><span class="o">.</span><span class="n">_algorithms</span><span class="p">]</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_algorithms</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
                <span class="s1">&#39;equivalent_indices&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">equivalent_indices</span><span class="p">,</span>
                <span class="s1">&#39;neighbors_sets_hints&#39;</span><span class="p">:</span> <span class="p">[</span><span class="n">nbsh</span><span class="o">.</span><span class="n">as_dict</span><span class="p">()</span> <span class="k">for</span> <span class="n">nbsh</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">neighbors_sets_hints</span><span class="p">]</span>
                <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">neighbors_sets_hints</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="kc">None</span><span class="p">}</span></div>

<div class="viewcode-block" id="CoordinationGeometry.from_dict"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.from_dict">[docs]</a>    <span class="nd">@classmethod</span>
    <span class="k">def</span> <span class="nf">from_dict</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">dd</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Reconstructs the CoordinationGeometry from its JSON serializable dict representation.</span>

<span class="sd">        Args:</span>
<span class="sd">            dd: a JSON serializable dict representation of a CoordinationGeometry.</span>

<span class="sd">        Returns: a CoordinationGeometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">dec</span> <span class="o">=</span> <span class="n">MontyDecoder</span><span class="p">()</span>
        <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">mp_symbol</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;mp_symbol&#39;</span><span class="p">],</span>
                   <span class="n">name</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">],</span>
                   <span class="n">alternative_names</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;alternative_names&#39;</span><span class="p">],</span>
                   <span class="n">IUPAC_symbol</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;IUPAC_symbol&#39;</span><span class="p">],</span>
                   <span class="n">IUCr_symbol</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;IUCr_symbol&#39;</span><span class="p">],</span>
                   <span class="n">coordination</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;coordination&#39;</span><span class="p">],</span>
                   <span class="n">central_site</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;central_site&#39;</span><span class="p">],</span>
                   <span class="n">points</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;points&#39;</span><span class="p">],</span>
                   <span class="n">solid_angles</span><span class="o">=</span><span class="p">(</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;solid_angles&#39;</span><span class="p">]</span> <span class="k">if</span> <span class="s1">&#39;solid_angles&#39;</span> <span class="ow">in</span> <span class="n">dd</span>
                                 <span class="k">else</span> <span class="p">[</span><span class="mf">4.0</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span> <span class="o">/</span> <span class="n">dd</span><span class="p">[</span><span class="s1">&#39;coordination&#39;</span><span class="p">]]</span> <span class="o">*</span> <span class="n">dd</span><span class="p">[</span>
                       <span class="s1">&#39;coordination&#39;</span><span class="p">]),</span>
                   <span class="n">deactivate</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;deactivate&#39;</span><span class="p">],</span>
                   <span class="n">faces</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;_faces&#39;</span><span class="p">],</span>
                   <span class="n">edges</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span><span class="s1">&#39;_edges&#39;</span><span class="p">],</span>
                   <span class="n">algorithms</span><span class="o">=</span><span class="p">[</span><span class="n">dec</span><span class="o">.</span><span class="n">process_decoded</span><span class="p">(</span><span class="n">algo_d</span><span class="p">)</span>
                               <span class="k">for</span> <span class="n">algo_d</span> <span class="ow">in</span> <span class="n">dd</span><span class="p">[</span><span class="s1">&#39;_algorithms&#39;</span><span class="p">]]</span> <span class="k">if</span> <span class="n">dd</span><span class="p">[</span><span class="s1">&#39;_algorithms&#39;</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
                   <span class="n">equivalent_indices</span><span class="o">=</span><span class="n">dd</span><span class="p">[</span>
                       <span class="s1">&#39;equivalent_indices&#39;</span><span class="p">]</span> <span class="k">if</span> <span class="s1">&#39;equivalent_indices&#39;</span> <span class="ow">in</span> <span class="n">dd</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
                   <span class="n">neighbors_sets_hints</span><span class="o">=</span><span class="p">[</span><span class="bp">cls</span><span class="o">.</span><span class="n">NeighborsSetsHints</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">nbshd</span><span class="p">)</span>
                                         <span class="k">for</span> <span class="n">nbshd</span> <span class="ow">in</span> <span class="n">dd</span><span class="p">[</span><span class="s1">&#39;neighbors_sets_hints&#39;</span><span class="p">]]</span>
                   <span class="k">if</span> <span class="p">(</span><span class="s1">&#39;neighbors_sets_hints&#39;</span> <span class="ow">in</span> <span class="n">dd</span> <span class="ow">and</span> <span class="n">dd</span><span class="p">[</span><span class="s1">&#39;neighbors_sets_hints&#39;</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">)</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span></div>

    <span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="n">symbol</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">IUPAC_symbol</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">symbol</span> <span class="o">+=</span> <span class="s1">&#39; (IUPAC: </span><span class="si">{s}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">s</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">IUPAC_symbol</span><span class="p">)</span>
            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">IUCr_symbol</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                <span class="n">symbol</span> <span class="o">+=</span> <span class="s1">&#39; || IUCr: </span><span class="si">{s}</span><span class="s1">)&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">s</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">IUCr_symbol</span><span class="p">)</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="n">symbol</span> <span class="o">+=</span> <span class="s1">&#39;)&#39;</span>
        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">IUCr_symbol</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">symbol</span> <span class="o">+=</span> <span class="s1">&#39; (IUCr: </span><span class="si">{s}</span><span class="s1">)&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">s</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">IUCr_symbol</span><span class="p">)</span>
        <span class="n">outs</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Coordination geometry type : </span><span class="si">{n}{s}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">n</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
                                                               <span class="n">s</span><span class="o">=</span><span class="n">symbol</span><span class="p">),</span>
                <span class="s1">&#39;  - coordination number : </span><span class="si">{c}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">c</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">coordination</span><span class="p">)]</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">points</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">outs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;... not yet implemented&#39;</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">outs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;  - list of points :&#39;</span><span class="p">)</span>
            <span class="k">for</span> <span class="n">pp</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">points</span><span class="p">:</span>
                <span class="n">outs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;    - </span><span class="si">{p}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">p</span><span class="o">=</span><span class="n">pp</span><span class="p">))</span>
        <span class="n">outs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
            <span class="s1">&#39;------------------------------------------------------------&#39;</span><span class="p">)</span>
        <span class="n">outs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;&#39;</span><span class="p">)</span>

        <span class="k">return</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">outs</span><span class="p">)</span>

    <span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="n">symbol</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">IUPAC_symbol</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">symbol</span> <span class="o">+=</span> <span class="s1">&#39; (IUPAC: </span><span class="si">{s}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">s</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">IUPAC_symbol</span><span class="p">)</span>
            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">IUCr_symbol</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                <span class="n">symbol</span> <span class="o">+=</span> <span class="s1">&#39; || IUCr: </span><span class="si">{s}</span><span class="s1">)&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">s</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">IUCr_symbol</span><span class="p">)</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="n">symbol</span> <span class="o">+=</span> <span class="s1">&#39;)&#39;</span>
        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">IUCr_symbol</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">symbol</span> <span class="o">+=</span> <span class="s1">&#39; (IUCr: </span><span class="si">{s}</span><span class="s1">)&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">s</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">IUCr_symbol</span><span class="p">)</span>
        <span class="n">outs</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Coordination geometry type : </span><span class="si">{n}{s}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">n</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
                                                               <span class="n">s</span><span class="o">=</span><span class="n">symbol</span><span class="p">),</span>
                <span class="s1">&#39;  - coordination number : </span><span class="si">{c}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">c</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">coordination</span><span class="p">)]</span>
        <span class="n">outs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
            <span class="s1">&#39;------------------------------------------------------------&#39;</span><span class="p">)</span>
        <span class="n">outs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;&#39;</span><span class="p">)</span>
        <span class="k">return</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">outs</span><span class="p">)</span>

    <span class="k">def</span> <span class="fm">__len__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">coordination</span>

<div class="viewcode-block" id="CoordinationGeometry.set_permutations_safe_override"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.set_permutations_safe_override">[docs]</a>    <span class="k">def</span> <span class="nf">set_permutations_safe_override</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">permutations_safe_override</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Setup ChemEnv so that a safe set of permutations are used.</span>

<span class="sd">        Args:</span>
<span class="sd">            permutations_safe_override: Whether to use safe permutations.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">permutations_safe_override</span> <span class="o">=</span> <span class="n">permutations_safe_override</span></div>
        <span class="c1"># self.setup_permutations()</span>

    <span class="c1"># @property</span>
    <span class="c1"># def csm_skip_algo(self):</span>
    <span class="c1">#     return self.CSM_SKIP_SEPARATION_PLANE_ALGO</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">distfactor_max</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        The maximum distfactor for the perfect CoordinationGeometry.</span>

<span class="sd">        Returns: Maximum distfactor for the perfect CoordinationGeometry (usually 1.0 for symmetric polyhedrons).</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">dists</span> <span class="o">=</span> <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">pp</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">central_site</span><span class="p">)</span> <span class="k">for</span> <span class="n">pp</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">points</span><span class="p">]</span>
        <span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">max</span><span class="p">(</span><span class="n">dists</span><span class="p">)</span> <span class="o">/</span> <span class="n">np</span><span class="o">.</span><span class="n">min</span><span class="p">(</span><span class="n">dists</span><span class="p">)</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">coordination_number</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the coordination number of this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">coordination</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">pauling_stability_ratio</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the theoretical Pauling stability ratio (rC/rA) for this environment.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_pauling_stability_ratio</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ce_symbol</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">&#39;S:1&#39;</span><span class="p">,</span> <span class="s1">&#39;L:2&#39;</span><span class="p">]:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pauling_stability_ratio</span> <span class="o">=</span> <span class="mf">0.0</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="n">mindist_anions</span> <span class="o">=</span> <span class="mf">1000000.0</span>
                <span class="n">mindist_cation_anion</span> <span class="o">=</span> <span class="mf">1000000.0</span>
                <span class="k">for</span> <span class="n">ipt1</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">points</span><span class="p">)):</span>
                    <span class="n">pt1</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">points</span><span class="p">[</span><span class="n">ipt1</span><span class="p">])</span>
                    <span class="n">mindist_cation_anion</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">mindist_cation_anion</span><span class="p">,</span>
                                               <span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">pt1</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">central_site</span><span class="p">))</span>
                    <span class="k">for</span> <span class="n">ipt2</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">ipt1</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">points</span><span class="p">)):</span>
                        <span class="n">pt2</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">points</span><span class="p">[</span><span class="n">ipt2</span><span class="p">])</span>
                        <span class="n">mindist_anions</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">mindist_anions</span><span class="p">,</span>
                                             <span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">pt1</span> <span class="o">-</span> <span class="n">pt2</span><span class="p">))</span>
                <span class="n">anion_radius</span> <span class="o">=</span> <span class="n">mindist_anions</span> <span class="o">/</span> <span class="mf">2.0</span>
                <span class="n">cation_radius</span> <span class="o">=</span> <span class="n">mindist_cation_anion</span> <span class="o">-</span> <span class="n">anion_radius</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pauling_stability_ratio</span> <span class="o">=</span> <span class="n">cation_radius</span> <span class="o">/</span> <span class="n">anion_radius</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_pauling_stability_ratio</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">mp_symbol</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the MP symbol of this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_mp_symbol</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">ce_symbol</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the symbol of this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_mp_symbol</span>

<div class="viewcode-block" id="CoordinationGeometry.get_coordination_number"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.get_coordination_number">[docs]</a>    <span class="k">def</span> <span class="nf">get_coordination_number</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the coordination number of this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">coordination</span></div>

<div class="viewcode-block" id="CoordinationGeometry.is_implemented"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.is_implemented">[docs]</a>    <span class="k">def</span> <span class="nf">is_implemented</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns True if this coordination geometry is implemented.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">points</span><span class="p">)</span></div>

<div class="viewcode-block" id="CoordinationGeometry.get_name"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.get_name">[docs]</a>    <span class="k">def</span> <span class="nf">get_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the name of this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span></div>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">IUPAC_symbol</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the IUPAC symbol of this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">IUPACsymbol</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">IUPAC_symbol_str</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns a string representation of the IUPAC symbol of this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">IUPACsymbol</span><span class="p">)</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">IUCr_symbol</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the IUCr symbol of this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">IUCrsymbol</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">IUCr_symbol_str</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns a string representation of the IUCr symbol of this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">IUCrsymbol</span><span class="p">)</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">number_of_permutations</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the number of permutations of this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">permutations_safe_override</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">factorial</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">coordination</span><span class="p">)</span>
        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">permutations</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">factorial</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">coordination</span><span class="p">)</span>
        <span class="k">return</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">permutations</span><span class="p">)</span>

<div class="viewcode-block" id="CoordinationGeometry.ref_permutation"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.ref_permutation">[docs]</a>    <span class="k">def</span> <span class="nf">ref_permutation</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">permutation</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the reference permutation for a set of equivalent permutations.</span>

<span class="sd">        Can be useful to skip permutations that have already been performed.</span>

<span class="sd">        Args:</span>
<span class="sd">            permutation: Current permutation</span>

<span class="sd">        Returns: Reference permutation of the perfect CoordinationGeometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">perms</span> <span class="o">=</span> <span class="p">[]</span>
        <span class="k">for</span> <span class="n">eqv_indices</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">equivalent_indices</span><span class="p">:</span>
            <span class="n">perms</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">tuple</span><span class="p">([</span><span class="n">permutation</span><span class="p">[</span><span class="n">ii</span><span class="p">]</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="n">eqv_indices</span><span class="p">]))</span>
        <span class="n">perms</span><span class="o">.</span><span class="n">sort</span><span class="p">()</span>
        <span class="k">return</span> <span class="n">perms</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span></div>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">algorithms</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the list of algorithms that are used to identify this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_algorithms</span>

<div class="viewcode-block" id="CoordinationGeometry.get_central_site"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.get_central_site">[docs]</a>    <span class="k">def</span> <span class="nf">get_central_site</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the central site of this coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">central_site</span></div>

<div class="viewcode-block" id="CoordinationGeometry.faces"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.faces">[docs]</a>    <span class="k">def</span> <span class="nf">faces</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sites</span><span class="p">,</span> <span class="n">permutation</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the list of faces of this coordination geometry. Each face is given as a</span>
<span class="sd">        list of its vertices coordinates.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="n">permutation</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">coords</span> <span class="o">=</span> <span class="p">[</span><span class="n">site</span><span class="o">.</span><span class="n">coords</span> <span class="k">for</span> <span class="n">site</span> <span class="ow">in</span> <span class="n">sites</span><span class="p">]</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">coords</span> <span class="o">=</span> <span class="p">[</span><span class="n">sites</span><span class="p">[</span><span class="n">ii</span><span class="p">]</span><span class="o">.</span><span class="n">coords</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="n">permutation</span><span class="p">]</span>
        <span class="k">return</span> <span class="p">[[</span><span class="n">coords</span><span class="p">[</span><span class="n">ii</span><span class="p">]</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="n">f</span><span class="p">]</span> <span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_faces</span><span class="p">]</span></div>

<div class="viewcode-block" id="CoordinationGeometry.edges"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.edges">[docs]</a>    <span class="k">def</span> <span class="nf">edges</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sites</span><span class="p">,</span> <span class="n">permutation</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">input</span><span class="o">=</span><span class="s1">&#39;sites&#39;</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the list of edges of this coordination geometry. Each edge is given as a</span>
<span class="sd">        list of its end vertices coordinates.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="nb">input</span> <span class="o">==</span> <span class="s1">&#39;sites&#39;</span><span class="p">:</span>
            <span class="n">coords</span> <span class="o">=</span> <span class="p">[</span><span class="n">site</span><span class="o">.</span><span class="n">coords</span> <span class="k">for</span> <span class="n">site</span> <span class="ow">in</span> <span class="n">sites</span><span class="p">]</span>
        <span class="k">elif</span> <span class="nb">input</span> <span class="o">==</span> <span class="s1">&#39;coords&#39;</span><span class="p">:</span>
            <span class="n">coords</span> <span class="o">=</span> <span class="n">sites</span>
        <span class="c1"># if permutation is None:</span>
        <span class="c1">#     coords = [site.coords for site in sites]</span>
        <span class="c1"># else:</span>
        <span class="c1">#     coords = [sites[ii].coords for ii in permutation]</span>
        <span class="k">if</span> <span class="n">permutation</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">coords</span> <span class="o">=</span> <span class="p">[</span><span class="n">coords</span><span class="p">[</span><span class="n">ii</span><span class="p">]</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="n">permutation</span><span class="p">]</span>
        <span class="k">return</span> <span class="p">[[</span><span class="n">coords</span><span class="p">[</span><span class="n">ii</span><span class="p">]</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="n">e</span><span class="p">]</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_edges</span><span class="p">]</span></div>

<div class="viewcode-block" id="CoordinationGeometry.solid_angles"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.solid_angles">[docs]</a>    <span class="k">def</span> <span class="nf">solid_angles</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">permutation</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the list of &quot;perfect&quot; solid angles Each edge is given as a</span>
<span class="sd">        list of its end vertices coordinates.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="n">permutation</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_solid_angles</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">return</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">_solid_angles</span><span class="p">[</span><span class="n">ii</span><span class="p">]</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="n">permutation</span><span class="p">]</span></div>

<div class="viewcode-block" id="CoordinationGeometry.get_pmeshes"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.CoordinationGeometry.get_pmeshes">[docs]</a>    <span class="k">def</span> <span class="nf">get_pmeshes</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sites</span><span class="p">,</span> <span class="n">permutation</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the pmesh strings used for jmol to show this geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">pmeshes</span> <span class="o">=</span> <span class="p">[]</span>
        <span class="c1"># _vertices = [site.coords for site in sites]</span>
        <span class="k">if</span> <span class="n">permutation</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">_vertices</span> <span class="o">=</span> <span class="p">[</span><span class="n">site</span><span class="o">.</span><span class="n">coords</span> <span class="k">for</span> <span class="n">site</span> <span class="ow">in</span> <span class="n">sites</span><span class="p">]</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">_vertices</span> <span class="o">=</span> <span class="p">[</span><span class="n">sites</span><span class="p">[</span><span class="n">ii</span><span class="p">]</span><span class="o">.</span><span class="n">coords</span> <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="n">permutation</span><span class="p">]</span>
        <span class="n">_face_centers</span> <span class="o">=</span> <span class="p">[]</span>
        <span class="n">number_of_faces</span> <span class="o">=</span> <span class="mi">0</span>
        <span class="k">for</span> <span class="n">face</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_faces</span><span class="p">:</span>
            <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">face</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">]:</span>
                <span class="n">number_of_faces</span> <span class="o">+=</span> <span class="mi">1</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="n">number_of_faces</span> <span class="o">+=</span> <span class="nb">len</span><span class="p">(</span><span class="n">face</span><span class="p">)</span>

            <span class="n">_face_centers</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">([</span><span class="n">_vertices</span><span class="p">[</span><span class="n">face_vertex</span><span class="p">][</span><span class="n">ii</span><span class="p">]</span>
                                                    <span class="k">for</span> <span class="n">face_vertex</span> <span class="ow">in</span> <span class="n">face</span><span class="p">])</span>
                                           <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">3</span><span class="p">)]))</span>

        <span class="n">out</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">_vertices</span><span class="p">)</span> <span class="o">+</span> <span class="nb">len</span><span class="p">(</span><span class="n">_face_centers</span><span class="p">))</span>
        <span class="k">for</span> <span class="n">vv</span> <span class="ow">in</span> <span class="n">_vertices</span><span class="p">:</span>
            <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="si">{:15.8f}</span><span class="s1"> </span><span class="si">{:15.8f}</span><span class="s1"> </span><span class="si">{:15.8f}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">vv</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">vv</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">vv</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
        <span class="k">for</span> <span class="n">fc</span> <span class="ow">in</span> <span class="n">_face_centers</span><span class="p">:</span>
            <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="si">{:15.8f}</span><span class="s1"> </span><span class="si">{:15.8f}</span><span class="s1"> </span><span class="si">{:15.8f}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">fc</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">fc</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">fc</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
        <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="si">{:d}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">number_of_faces</span><span class="p">)</span>
        <span class="k">for</span> <span class="n">iface</span><span class="p">,</span> <span class="n">face</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_faces</span><span class="p">):</span>
            <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">face</span><span class="p">)</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
                <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;4</span><span class="se">\n</span><span class="s1">&#39;</span>
            <span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">face</span><span class="p">)</span> <span class="o">==</span> <span class="mi">4</span><span class="p">:</span>
                <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;5</span><span class="se">\n</span><span class="s1">&#39;</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">face</span><span class="p">)):</span>
                    <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;4</span><span class="se">\n</span><span class="s1">&#39;</span>
                    <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="si">{:d}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">_vertices</span><span class="p">)</span> <span class="o">+</span> <span class="n">iface</span><span class="p">)</span>
                    <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="si">{:d}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">face</span><span class="p">[</span><span class="n">ii</span><span class="p">])</span>
                    <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="si">{:d}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">face</span><span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">mod</span><span class="p">(</span><span class="n">ii</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">face</span><span class="p">))])</span>
                    <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="si">{:d}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">_vertices</span><span class="p">)</span> <span class="o">+</span> <span class="n">iface</span><span class="p">)</span>
            <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">face</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">]:</span>
                <span class="k">for</span> <span class="n">face_vertex</span> <span class="ow">in</span> <span class="n">face</span><span class="p">:</span>
                    <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="si">{:d}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">face_vertex</span><span class="p">)</span>
                <span class="n">out</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="si">{:d}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">face</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
        <span class="n">pmeshes</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">&quot;pmesh_string&quot;</span><span class="p">:</span> <span class="n">out</span><span class="p">})</span>
        <span class="k">return</span> <span class="n">pmeshes</span></div></div>


<div class="viewcode-block" id="AllCoordinationGeometries"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries">[docs]</a><span class="k">class</span> <span class="nc">AllCoordinationGeometries</span><span class="p">(</span><span class="nb">dict</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">    Class used to store all the reference &quot;coordination geometries&quot; (list with instances of the CoordinationGeometry</span>
<span class="sd">    classes)</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">permutations_safe_override</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">only_symbols</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Initializes the list of Coordination Geometries.</span>

<span class="sd">        Args:</span>
<span class="sd">            permutations_safe_override: Whether to use safe permutations.</span>
<span class="sd">            only_symbols: Whether to restrict the list of environments to be identified.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="nb">dict</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
        <span class="k">if</span> <span class="n">only_symbols</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">f</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span>
                <span class="s1">&#39;</span><span class="si">{}</span><span class="s1">/coordination_geometries_files/allcg.txt&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">module_dir</span><span class="p">),</span>
                <span class="s1">&#39;r&#39;</span><span class="p">)</span>
            <span class="n">data</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">readlines</span><span class="p">()</span>
            <span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
            <span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">data</span><span class="p">:</span>
                <span class="n">cg_file</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{}</span><span class="s1">/</span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">module_dir</span><span class="p">,</span> <span class="n">line</span><span class="o">.</span><span class="n">strip</span><span class="p">())</span>
                <span class="n">f</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">cg_file</span><span class="p">,</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span>
                <span class="n">dd</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
                <span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">CoordinationGeometry</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">dd</span><span class="p">))</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">symbol</span> <span class="ow">in</span> <span class="n">only_symbols</span><span class="p">:</span>
                <span class="n">fsymbol</span> <span class="o">=</span> <span class="n">symbol</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;:&#39;</span><span class="p">,</span> <span class="s1">&#39;#&#39;</span><span class="p">)</span>
                <span class="n">cg_file</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{}</span><span class="s1">/coordination_geometries_files/</span><span class="si">{}</span><span class="s1">.json&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                    <span class="n">module_dir</span><span class="p">,</span> <span class="n">fsymbol</span><span class="p">)</span>
                <span class="n">f</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">cg_file</span><span class="p">,</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span>
                <span class="n">dd</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
                <span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">CoordinationGeometry</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">dd</span><span class="p">))</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">CoordinationGeometry</span><span class="p">(</span><span class="n">UNKNOWN_ENVIRONMENT_SYMBOL</span><span class="p">,</span>
                                                 <span class="s2">&quot;Unknown environment&quot;</span><span class="p">,</span>
                                                 <span class="n">deactivate</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">CoordinationGeometry</span><span class="p">(</span><span class="n">UNCLEAR_ENVIRONMENT_SYMBOL</span><span class="p">,</span>
                                                 <span class="s2">&quot;Unclear environment&quot;</span><span class="p">,</span>
                                                 <span class="n">deactivate</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
        <span class="k">if</span> <span class="n">permutations_safe_override</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">cg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
                <span class="n">cg</span><span class="o">.</span><span class="n">set_permutations_safe_override</span><span class="p">(</span><span class="kc">True</span><span class="p">)</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">minpoints</span> <span class="o">=</span> <span class="p">{}</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">maxpoints</span> <span class="o">=</span> <span class="p">{}</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">separations_cg</span> <span class="o">=</span> <span class="p">{}</span>
        <span class="k">for</span> <span class="n">cn</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">21</span><span class="p">):</span>
            <span class="k">for</span> <span class="n">cg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_implemented_geometries</span><span class="p">(</span><span class="n">coordination</span><span class="o">=</span><span class="n">cn</span><span class="p">):</span>
                <span class="k">if</span> <span class="n">only_symbols</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">cg</span><span class="o">.</span><span class="n">ce_symbol</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">only_symbols</span><span class="p">:</span>
                    <span class="k">continue</span>
                <span class="k">if</span> <span class="n">cn</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">separations_cg</span><span class="p">:</span>
                    <span class="bp">self</span><span class="o">.</span><span class="n">minpoints</span><span class="p">[</span><span class="n">cn</span><span class="p">]</span> <span class="o">=</span> <span class="mi">1000</span>
                    <span class="bp">self</span><span class="o">.</span><span class="n">maxpoints</span><span class="p">[</span><span class="n">cn</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span>
                    <span class="bp">self</span><span class="o">.</span><span class="n">separations_cg</span><span class="p">[</span><span class="n">cn</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>
                <span class="k">for</span> <span class="n">algo</span> <span class="ow">in</span> <span class="n">cg</span><span class="o">.</span><span class="n">algorithms</span><span class="p">:</span>
                    <span class="n">sep</span> <span class="o">=</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">algo</span><span class="o">.</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span>
                           <span class="nb">len</span><span class="p">(</span><span class="n">algo</span><span class="o">.</span><span class="n">plane_points</span><span class="p">),</span>
                           <span class="nb">len</span><span class="p">(</span><span class="n">algo</span><span class="o">.</span><span class="n">point_groups</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>
                    <span class="k">if</span> <span class="n">sep</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">separations_cg</span><span class="p">[</span><span class="n">cn</span><span class="p">]:</span>
                        <span class="bp">self</span><span class="o">.</span><span class="n">separations_cg</span><span class="p">[</span><span class="n">cn</span><span class="p">][</span><span class="n">sep</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span>
                    <span class="bp">self</span><span class="o">.</span><span class="n">separations_cg</span><span class="p">[</span><span class="n">cn</span><span class="p">][</span><span class="n">sep</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">)</span>
                    <span class="bp">self</span><span class="o">.</span><span class="n">minpoints</span><span class="p">[</span><span class="n">cn</span><span class="p">]</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">minpoints</span><span class="p">[</span><span class="n">cn</span><span class="p">],</span> <span class="n">algo</span><span class="o">.</span><span class="n">minimum_number_of_points</span><span class="p">)</span>
                    <span class="bp">self</span><span class="o">.</span><span class="n">maxpoints</span><span class="p">[</span><span class="n">cn</span><span class="p">]</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">maxpoints</span><span class="p">[</span><span class="n">cn</span><span class="p">],</span> <span class="n">algo</span><span class="o">.</span><span class="n">maximum_number_of_points</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">maxpoints_inplane</span> <span class="o">=</span> <span class="p">{</span><span class="n">cn</span><span class="p">:</span> <span class="nb">max</span><span class="p">([</span><span class="n">sep</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="k">for</span> <span class="n">sep</span> <span class="ow">in</span> <span class="n">seps</span><span class="o">.</span><span class="n">keys</span><span class="p">()])</span> <span class="k">for</span> <span class="n">cn</span><span class="p">,</span> <span class="n">seps</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">separations_cg</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span>

    <span class="k">def</span> <span class="fm">__getitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_geometry_from_mp_symbol</span><span class="p">(</span><span class="n">key</span><span class="p">)</span>

    <span class="k">def</span> <span class="fm">__contains__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="p">[</span><span class="n">item</span><span class="p">]</span>
            <span class="k">return</span> <span class="kc">True</span>
        <span class="k">except</span> <span class="ne">LookupError</span><span class="p">:</span>
            <span class="k">return</span> <span class="kc">False</span>

    <span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns a string with the list of coordination geometries.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">outs</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="s1">&#39;#=================================#&#39;</span><span class="p">,</span>
                <span class="s1">&#39;# List of coordination geometries #&#39;</span><span class="p">,</span>
                <span class="s1">&#39;#=================================#&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">]</span>
        <span class="k">for</span> <span class="n">cg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
            <span class="n">outs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">repr</span><span class="p">(</span><span class="n">cg</span><span class="p">))</span>

        <span class="k">return</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">outs</span><span class="p">)</span>

    <span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns a string with the list of coordination geometries that are implemented.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">outs</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="s1">&#39;#=======================================================#&#39;</span><span class="p">,</span>
                <span class="s1">&#39;# List of coordination geometries currently implemented #&#39;</span><span class="p">,</span>
                <span class="s1">&#39;#=======================================================#&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">]</span>
        <span class="k">for</span> <span class="n">cg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
            <span class="k">if</span> <span class="n">cg</span><span class="o">.</span><span class="n">is_implemented</span><span class="p">():</span>
                <span class="n">outs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">cg</span><span class="p">))</span>

        <span class="k">return</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">outs</span><span class="p">)</span>

<div class="viewcode-block" id="AllCoordinationGeometries.get_geometries"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries.get_geometries">[docs]</a>    <span class="k">def</span> <span class="nf">get_geometries</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">coordination</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">returned</span><span class="o">=</span><span class="s1">&#39;cg&#39;</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns a list of coordination geometries with the given coordination number.</span>

<span class="sd">        Args:</span>
<span class="sd">            coordination: The coordination number of which the list of coordination geometries are returned.</span>
<span class="sd">            returned: Type of objects in the list.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">geom</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
        <span class="k">if</span> <span class="n">coordination</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
                <span class="k">if</span> <span class="n">returned</span> <span class="o">==</span> <span class="s1">&#39;cg&#39;</span><span class="p">:</span>
                    <span class="n">geom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">gg</span><span class="p">)</span>
                <span class="k">elif</span> <span class="n">returned</span> <span class="o">==</span> <span class="s1">&#39;mp_symbol&#39;</span><span class="p">:</span>
                    <span class="n">geom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">gg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
                <span class="k">if</span> <span class="n">gg</span><span class="o">.</span><span class="n">get_coordination_number</span><span class="p">()</span> <span class="o">==</span> <span class="n">coordination</span><span class="p">:</span>
                    <span class="k">if</span> <span class="n">returned</span> <span class="o">==</span> <span class="s1">&#39;cg&#39;</span><span class="p">:</span>
                        <span class="n">geom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">gg</span><span class="p">)</span>
                    <span class="k">elif</span> <span class="n">returned</span> <span class="o">==</span> <span class="s1">&#39;mp_symbol&#39;</span><span class="p">:</span>
                        <span class="n">geom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">gg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">geom</span></div>

<div class="viewcode-block" id="AllCoordinationGeometries.get_symbol_name_mapping"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries.get_symbol_name_mapping">[docs]</a>    <span class="k">def</span> <span class="nf">get_symbol_name_mapping</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">coordination</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Return a dictionary mapping the symbol of a CoordinationGeometry to its name.</span>

<span class="sd">        Args:</span>
<span class="sd">            coordination: Whether to restrict the dictionary to a given coordination.</span>

<span class="sd">        Returns: Dictionary mapping the symbol of a CoordinationGeometry to its name.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">geom</span> <span class="o">=</span> <span class="p">{}</span>
        <span class="k">if</span> <span class="n">coordination</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
                <span class="n">geom</span><span class="p">[</span><span class="n">gg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">]</span> <span class="o">=</span> <span class="n">gg</span><span class="o">.</span><span class="n">name</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
                <span class="k">if</span> <span class="n">gg</span><span class="o">.</span><span class="n">get_coordination_number</span><span class="p">()</span> <span class="o">==</span> <span class="n">coordination</span><span class="p">:</span>
                    <span class="n">geom</span><span class="p">[</span><span class="n">gg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">]</span> <span class="o">=</span> <span class="n">gg</span><span class="o">.</span><span class="n">name</span>
        <span class="k">return</span> <span class="n">geom</span></div>

<div class="viewcode-block" id="AllCoordinationGeometries.get_symbol_cn_mapping"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries.get_symbol_cn_mapping">[docs]</a>    <span class="k">def</span> <span class="nf">get_symbol_cn_mapping</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">coordination</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Return a dictionary mapping the symbol of a CoordinationGeometry to its coordination.</span>

<span class="sd">        Args:</span>
<span class="sd">            coordination: Whether to restrict the dictionary to a given coordination.</span>

<span class="sd">        Returns: Dictionary mapping the symbol of a CoordinationGeometry to its coordination.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">geom</span> <span class="o">=</span> <span class="p">{}</span>
        <span class="k">if</span> <span class="n">coordination</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
                <span class="n">geom</span><span class="p">[</span><span class="n">gg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">]</span> <span class="o">=</span> <span class="n">gg</span><span class="o">.</span><span class="n">coordination_number</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
                <span class="k">if</span> <span class="n">gg</span><span class="o">.</span><span class="n">get_coordination_number</span><span class="p">()</span> <span class="o">==</span> <span class="n">coordination</span><span class="p">:</span>
                    <span class="n">geom</span><span class="p">[</span><span class="n">gg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">]</span> <span class="o">=</span> <span class="n">gg</span><span class="o">.</span><span class="n">coordination_number</span>
        <span class="k">return</span> <span class="n">geom</span></div>

<div class="viewcode-block" id="AllCoordinationGeometries.get_implemented_geometries"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries.get_implemented_geometries">[docs]</a>    <span class="k">def</span> <span class="nf">get_implemented_geometries</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">coordination</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">returned</span><span class="o">=</span><span class="s1">&#39;cg&#39;</span><span class="p">,</span>
                                   <span class="n">include_deactivated</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns a list of the implemented coordination geometries with the given coordination number.</span>

<span class="sd">        Args:</span>
<span class="sd">            coordination: The coordination number of which the list of implemented coordination geometries</span>
<span class="sd">                are returned.</span>
<span class="sd">            returned: Type of objects in the list.</span>
<span class="sd">            include_deactivated: Whether to include CoordinationGeometry that are deactivated.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">geom</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
        <span class="k">if</span> <span class="n">coordination</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
                <span class="k">if</span> <span class="n">gg</span><span class="o">.</span><span class="n">points</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="p">(</span>
                        <span class="p">(</span><span class="ow">not</span> <span class="n">gg</span><span class="o">.</span><span class="n">deactivate</span><span class="p">)</span> <span class="ow">or</span> <span class="n">include_deactivated</span><span class="p">):</span>
                    <span class="k">if</span> <span class="n">returned</span> <span class="o">==</span> <span class="s1">&#39;cg&#39;</span><span class="p">:</span>
                        <span class="n">geom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">gg</span><span class="p">)</span>
                    <span class="k">elif</span> <span class="n">returned</span> <span class="o">==</span> <span class="s1">&#39;mp_symbol&#39;</span><span class="p">:</span>
                        <span class="n">geom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">gg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
                <span class="k">if</span> <span class="n">gg</span><span class="o">.</span><span class="n">get_coordination_number</span><span class="p">()</span> <span class="o">==</span> <span class="n">coordination</span> <span class="ow">and</span> <span class="n">gg</span><span class="o">.</span><span class="n">points</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> \
                        <span class="p">((</span><span class="ow">not</span> <span class="n">gg</span><span class="o">.</span><span class="n">deactivate</span><span class="p">)</span> <span class="ow">or</span> <span class="n">include_deactivated</span><span class="p">):</span>
                    <span class="k">if</span> <span class="n">returned</span> <span class="o">==</span> <span class="s1">&#39;cg&#39;</span><span class="p">:</span>
                        <span class="n">geom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">gg</span><span class="p">)</span>
                    <span class="k">elif</span> <span class="n">returned</span> <span class="o">==</span> <span class="s1">&#39;mp_symbol&#39;</span><span class="p">:</span>
                        <span class="n">geom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">gg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">geom</span></div>

<div class="viewcode-block" id="AllCoordinationGeometries.get_not_implemented_geometries"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries.get_not_implemented_geometries">[docs]</a>    <span class="k">def</span> <span class="nf">get_not_implemented_geometries</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">coordination</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                                       <span class="n">returned</span><span class="o">=</span><span class="s1">&#39;mp_symbol&#39;</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns a list of the implemented coordination geometries with the given coordination number.</span>

<span class="sd">        Args:</span>
<span class="sd">            coordination: The coordination number of which the list of implemented coordination geometries</span>
<span class="sd">                are returned.</span>
<span class="sd">            returned: Type of objects in the list.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">geom</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
        <span class="k">if</span> <span class="n">coordination</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
                <span class="k">if</span> <span class="n">gg</span><span class="o">.</span><span class="n">points</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
                    <span class="k">if</span> <span class="n">returned</span> <span class="o">==</span> <span class="s1">&#39;cg&#39;</span><span class="p">:</span>
                        <span class="n">geom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">gg</span><span class="p">)</span>
                    <span class="k">elif</span> <span class="n">returned</span> <span class="o">==</span> <span class="s1">&#39;mp_symbol&#39;</span><span class="p">:</span>
                        <span class="n">geom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">gg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
                <span class="k">if</span> <span class="n">gg</span><span class="o">.</span><span class="n">get_coordination_number</span><span class="p">()</span> <span class="o">==</span> <span class="n">coordination</span> <span class="ow">and</span> <span class="n">gg</span><span class="o">.</span><span class="n">points</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
                    <span class="k">if</span> <span class="n">returned</span> <span class="o">==</span> <span class="s1">&#39;cg&#39;</span><span class="p">:</span>
                        <span class="n">geom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">gg</span><span class="p">)</span>
                    <span class="k">elif</span> <span class="n">returned</span> <span class="o">==</span> <span class="s1">&#39;mp_symbol&#39;</span><span class="p">:</span>
                        <span class="n">geom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">gg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">geom</span></div>

<div class="viewcode-block" id="AllCoordinationGeometries.get_geometry_from_name"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries.get_geometry_from_name">[docs]</a>    <span class="k">def</span> <span class="nf">get_geometry_from_name</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the coordination geometry of the given name.</span>

<span class="sd">        Args:</span>
<span class="sd">            name: The name of the coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
            <span class="k">if</span> <span class="n">gg</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="n">name</span> <span class="ow">or</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">gg</span><span class="o">.</span><span class="n">alternative_names</span><span class="p">:</span>
                <span class="k">return</span> <span class="n">gg</span>
        <span class="k">raise</span> <span class="ne">LookupError</span><span class="p">(</span>
            <span class="s1">&#39;No coordination geometry found with name &quot;</span><span class="si">{name}</span><span class="s1">&quot;&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">))</span></div>

<div class="viewcode-block" id="AllCoordinationGeometries.get_geometry_from_IUPAC_symbol"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries.get_geometry_from_IUPAC_symbol">[docs]</a>    <span class="k">def</span> <span class="nf">get_geometry_from_IUPAC_symbol</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">IUPAC_symbol</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the coordination geometry of the given IUPAC symbol.</span>

<span class="sd">        Args:</span>
<span class="sd">            IUPAC_symbol: The IUPAC symbol of the coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
            <span class="k">if</span> <span class="n">gg</span><span class="o">.</span><span class="n">IUPAC_symbol</span> <span class="o">==</span> <span class="n">IUPAC_symbol</span><span class="p">:</span>
                <span class="k">return</span> <span class="n">gg</span>
        <span class="k">raise</span> <span class="ne">LookupError</span><span class="p">(</span>
            <span class="s1">&#39;No coordination geometry found with IUPAC symbol &quot;</span><span class="si">{symbol}</span><span class="s1">&quot;&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                <span class="n">symbol</span><span class="o">=</span><span class="n">IUPAC_symbol</span><span class="p">))</span></div>

<div class="viewcode-block" id="AllCoordinationGeometries.get_geometry_from_IUCr_symbol"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries.get_geometry_from_IUCr_symbol">[docs]</a>    <span class="k">def</span> <span class="nf">get_geometry_from_IUCr_symbol</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">IUCr_symbol</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the coordination geometry of the given IUCr symbol.</span>

<span class="sd">        Args:</span>
<span class="sd">            IUCr_symbol: The IUCr symbol of the coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
            <span class="k">if</span> <span class="n">gg</span><span class="o">.</span><span class="n">IUCr_symbol</span> <span class="o">==</span> <span class="n">IUCr_symbol</span><span class="p">:</span>
                <span class="k">return</span> <span class="n">gg</span>
        <span class="k">raise</span> <span class="ne">LookupError</span><span class="p">(</span>
            <span class="s1">&#39;No coordination geometry found with IUCr symbol &quot;</span><span class="si">{symbol}</span><span class="s1">&quot;&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                <span class="n">symbol</span><span class="o">=</span><span class="n">IUCr_symbol</span><span class="p">))</span></div>

<div class="viewcode-block" id="AllCoordinationGeometries.get_geometry_from_mp_symbol"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries.get_geometry_from_mp_symbol">[docs]</a>    <span class="k">def</span> <span class="nf">get_geometry_from_mp_symbol</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mp_symbol</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Returns the coordination geometry of the given mp_symbol.</span>

<span class="sd">        Args:</span>
<span class="sd">            mp_symbol: The mp_symbol of the coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">for</span> <span class="n">gg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cg_list</span><span class="p">:</span>
            <span class="k">if</span> <span class="n">gg</span><span class="o">.</span><span class="n">mp_symbol</span> <span class="o">==</span> <span class="n">mp_symbol</span><span class="p">:</span>
                <span class="k">return</span> <span class="n">gg</span>
        <span class="k">raise</span> <span class="ne">LookupError</span><span class="p">(</span>
            <span class="s1">&#39;No coordination geometry found with mp_symbol &quot;</span><span class="si">{symbol}</span><span class="s1">&quot;&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                <span class="n">symbol</span><span class="o">=</span><span class="n">mp_symbol</span><span class="p">))</span></div>

<div class="viewcode-block" id="AllCoordinationGeometries.is_a_valid_coordination_geometry"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries.is_a_valid_coordination_geometry">[docs]</a>    <span class="k">def</span> <span class="nf">is_a_valid_coordination_geometry</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mp_symbol</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                                         <span class="n">IUPAC_symbol</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">IUCr_symbol</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                                         <span class="n">name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">cn</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Checks whether a given coordination geometry is valid (exists) and whether the parameters are coherent with</span>
<span class="sd">        each other.</span>

<span class="sd">        Args:</span>
<span class="sd">            mp_symbol: The mp_symbol of the coordination geometry.</span>
<span class="sd">            IUPAC_symbol: The IUPAC_symbol of the coordination geometry.</span>
<span class="sd">            IUCr_symbol: The IUCr_symbol of the coordination geometry.</span>
<span class="sd">            name: The name of the coordination geometry.</span>
<span class="sd">            cn: The coordination of the coordination geometry.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="n">name</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span>
                <span class="s1">&#39;is_a_valid_coordination_geometry not implemented for the name&#39;</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">mp_symbol</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">IUPAC_symbol</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">IUCr_symbol</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">raise</span> <span class="ne">SyntaxError</span><span class="p">(</span>
                <span class="s1">&#39;missing argument for is_a_valid_coordination_geometry : at least one of mp_symbol, &#39;</span>
                <span class="s1">&#39;IUPAC_symbol and IUCr_symbol must be passed to the function&#39;</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">mp_symbol</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">try</span><span class="p">:</span>
                <span class="n">cg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_geometry_from_mp_symbol</span><span class="p">(</span><span class="n">mp_symbol</span><span class="p">)</span>
                <span class="k">if</span> <span class="n">IUPAC_symbol</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                    <span class="k">if</span> <span class="n">IUPAC_symbol</span> <span class="o">!=</span> <span class="n">cg</span><span class="o">.</span><span class="n">IUPAC_symbol</span><span class="p">:</span>
                        <span class="k">return</span> <span class="kc">False</span>
                <span class="k">if</span> <span class="n">IUCr_symbol</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                    <span class="k">if</span> <span class="n">IUCr_symbol</span> <span class="o">!=</span> <span class="n">cg</span><span class="o">.</span><span class="n">IUCr_symbol</span><span class="p">:</span>
                        <span class="k">return</span> <span class="kc">False</span>
                <span class="k">if</span> <span class="n">cn</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                    <span class="k">if</span> <span class="nb">int</span><span class="p">(</span><span class="n">cn</span><span class="p">)</span> <span class="o">!=</span> <span class="nb">int</span><span class="p">(</span><span class="n">cg</span><span class="o">.</span><span class="n">coordination_number</span><span class="p">):</span>
                        <span class="k">return</span> <span class="kc">False</span>
                <span class="k">return</span> <span class="kc">True</span>
            <span class="k">except</span> <span class="ne">LookupError</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">False</span>
        <span class="k">elif</span> <span class="n">IUPAC_symbol</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">try</span><span class="p">:</span>
                <span class="n">cg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_geometry_from_IUPAC_symbol</span><span class="p">(</span><span class="n">IUPAC_symbol</span><span class="p">)</span>
                <span class="k">if</span> <span class="n">IUCr_symbol</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                    <span class="k">if</span> <span class="n">IUCr_symbol</span> <span class="o">!=</span> <span class="n">cg</span><span class="o">.</span><span class="n">IUCr_symbol</span><span class="p">:</span>
                        <span class="k">return</span> <span class="kc">False</span>
                <span class="k">if</span> <span class="n">cn</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                    <span class="k">if</span> <span class="n">cn</span> <span class="o">!=</span> <span class="n">cg</span><span class="o">.</span><span class="n">coordination_number</span><span class="p">:</span>
                        <span class="k">return</span> <span class="kc">False</span>
                <span class="k">return</span> <span class="kc">True</span>
            <span class="k">except</span> <span class="ne">LookupError</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">False</span>
        <span class="k">elif</span> <span class="n">IUCr_symbol</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">try</span><span class="p">:</span>
                <span class="n">cg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_geometry_from_IUCr_symbol</span><span class="p">(</span><span class="n">IUCr_symbol</span><span class="p">)</span>
                <span class="k">if</span> <span class="n">cn</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                    <span class="k">if</span> <span class="n">cn</span> <span class="o">!=</span> <span class="n">cg</span><span class="o">.</span><span class="n">coordination_number</span><span class="p">:</span>
                        <span class="k">return</span> <span class="kc">False</span>
                <span class="k">return</span> <span class="kc">True</span>
            <span class="k">except</span> <span class="ne">LookupError</span><span class="p">:</span>
                <span class="k">return</span> <span class="kc">True</span>
        <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s1">&#39;Should not be here !&#39;</span><span class="p">)</span></div>

<div class="viewcode-block" id="AllCoordinationGeometries.pretty_print"><a class="viewcode-back" href="../../../../../pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.html#pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries.pretty_print">[docs]</a>    <span class="k">def</span> <span class="nf">pretty_print</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s1">&#39;implemented_geometries&#39;</span><span class="p">,</span> <span class="n">maxcn</span><span class="o">=</span><span class="mi">8</span><span class="p">,</span> <span class="n">additional_info</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Return a string with a list of the Coordination Geometries.</span>

<span class="sd">        Args:</span>
<span class="sd">            type: Type of string to be returned (all_geometries, all_geometries_latex_images, all_geometries_latex,</span>
<span class="sd">                implemented_geometries).</span>
<span class="sd">            maxcn: Maximum coordination.</span>
<span class="sd">            additional_info: Whether to add some additional info for each coordination geometry.</span>

<span class="sd">        Returns: String describing the list of coordination geometries.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="nb">type</span> <span class="o">==</span> <span class="s1">&#39;all_geometries_latex_images&#39;</span><span class="p">:</span>
            <span class="n">mystring</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
            <span class="k">for</span> <span class="n">cn</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">maxcn</span> <span class="o">+</span> <span class="mi">1</span><span class="p">):</span>
                <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">section*{{Coordination </span><span class="si">{cn}</span><span class="s1">}}</span><span class="se">\n\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">cn</span><span class="o">=</span><span class="n">cn</span><span class="p">)</span>
                <span class="k">for</span> <span class="n">cg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_implemented_geometries</span><span class="p">(</span><span class="n">coordination</span><span class="o">=</span><span class="n">cn</span><span class="p">,</span>
                                                          <span class="n">returned</span><span class="o">=</span><span class="s1">&#39;cg&#39;</span><span class="p">):</span>
                    <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">subsubsection*{{</span><span class="si">{mp}</span><span class="s1"> : </span><span class="si">{name}</span><span class="s1">}}</span><span class="se">\n\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                        <span class="n">mp</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">get_name</span><span class="p">())</span>
                    <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;IUPAC : </span><span class="si">{iupac}</span><span class="se">\n\n</span><span class="s1">IUCr : </span><span class="si">{iucr}</span><span class="se">\n\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                        <span class="n">iupac</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">IUPAC_symbol</span><span class="p">,</span> <span class="n">iucr</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">IUCr_symbol</span><span class="p">)</span>
                    <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">begin</span><span class="si">{center}</span><span class="se">\n</span><span class="s1">&#39;</span>
                    <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">includegraphics[scale=0.15]{{images/</span><span class="si">{let}</span><span class="s1">_</span><span class="si">{cif}</span><span class="s1">.png}}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                        <span class="n">let</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;:&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">],</span>
                        <span class="n">cif</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;:&#39;</span><span class="p">)[</span><span class="mi">1</span><span class="p">])</span>
                    <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">end</span><span class="si">{center}</span><span class="se">\n\n</span><span class="s1">&#39;</span>
                <span class="k">for</span> <span class="n">cg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_not_implemented_geometries</span><span class="p">(</span><span class="n">cn</span><span class="p">,</span>
                                                              <span class="n">returned</span><span class="o">=</span><span class="s1">&#39;cg&#39;</span><span class="p">):</span>
                    <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">subsubsection*{{</span><span class="si">{mp}</span><span class="s1"> : </span><span class="si">{name}</span><span class="s1">}}</span><span class="se">\n\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                        <span class="n">mp</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">get_name</span><span class="p">())</span>
                    <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;IUPAC : </span><span class="si">{iupac}</span><span class="se">\n\n</span><span class="s1">IUCr : </span><span class="si">{iucr}</span><span class="se">\n\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                        <span class="n">iupac</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">IUPAC_symbol</span><span class="p">,</span> <span class="n">iucr</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">IUCr_symbol</span><span class="p">)</span>
        <span class="k">elif</span> <span class="nb">type</span> <span class="o">==</span> <span class="s1">&#39;all_geometries_latex&#39;</span><span class="p">:</span>
            <span class="n">mystring</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
            <span class="k">for</span> <span class="n">cn</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">maxcn</span> <span class="o">+</span> <span class="mi">1</span><span class="p">):</span>
                <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">subsection*{{Coordination </span><span class="si">{cn}</span><span class="s1">}}</span><span class="se">\n\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                    <span class="n">cn</span><span class="o">=</span><span class="n">cn</span><span class="p">)</span>
                <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">begin</span><span class="si">{itemize}</span><span class="se">\n</span><span class="s1">&#39;</span>
                <span class="k">for</span> <span class="n">cg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_implemented_geometries</span><span class="p">(</span><span class="n">coordination</span><span class="o">=</span><span class="n">cn</span><span class="p">,</span>
                                                          <span class="n">returned</span><span class="o">=</span><span class="s1">&#39;cg&#39;</span><span class="p">):</span>
                    <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">item </span><span class="si">{mp}</span><span class="s1"> $</span><span class="se">\\</span><span class="s1">rightarrow$ </span><span class="si">{name}</span><span class="s1"> &#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                        <span class="n">mp</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;_&#39;</span><span class="p">,</span>
                                                <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">_&#39;</span><span class="p">),</span>
                        <span class="n">name</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">get_name</span><span class="p">())</span>
                    <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;(IUPAC : </span><span class="si">{iupac}</span><span class="s1"> - IUCr : </span><span class="si">{iucr}</span><span class="s1">)</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                        <span class="n">iupac</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">IUPAC_symbol_str</span><span class="p">,</span>
                        <span class="n">iucr</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">IUCr_symbol_str</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;[&#39;</span><span class="p">,</span> <span class="s1">&#39;$[$&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;]&#39;</span><span class="p">,</span>
                                                                            <span class="s1">&#39;$]$&#39;</span><span class="p">))</span>
                <span class="k">for</span> <span class="n">cg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_not_implemented_geometries</span><span class="p">(</span><span class="n">cn</span><span class="p">,</span>
                                                              <span class="n">returned</span><span class="o">=</span><span class="s1">&#39;cg&#39;</span><span class="p">):</span>
                    <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">item </span><span class="si">{mp}</span><span class="s1"> $</span><span class="se">\\</span><span class="s1">rightarrow$ </span><span class="si">{name}</span><span class="s1"> &#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                        <span class="n">mp</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;_&#39;</span><span class="p">,</span>
                                                <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">_&#39;</span><span class="p">),</span>
                        <span class="n">name</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">get_name</span><span class="p">())</span>
                    <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;(IUPAC : </span><span class="si">{iupac}</span><span class="s1"> - IUCr : </span><span class="si">{iucr}</span><span class="s1">)</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                        <span class="n">iupac</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">IUPAC_symbol_str</span><span class="p">,</span>
                        <span class="n">iucr</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">IUCr_symbol_str</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;[&#39;</span><span class="p">,</span> <span class="s1">&#39;$[$&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;]&#39;</span><span class="p">,</span>
                                                                            <span class="s1">&#39;$]$&#39;</span><span class="p">))</span>
                <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\\</span><span class="s1">end</span><span class="si">{itemize}</span><span class="se">\n\n</span><span class="s1">&#39;</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">mystring</span> <span class="o">=</span> <span class="s1">&#39;+-------------------------+</span><span class="se">\n</span><span class="s1">| Coordination geometries |</span><span class="se">\n</span><span class="s1">+-------------------------+</span><span class="se">\n\n</span><span class="s1">&#39;</span>
            <span class="k">for</span> <span class="n">cn</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">maxcn</span> <span class="o">+</span> <span class="mi">1</span><span class="p">):</span>
                <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;==&gt;&gt; CN = </span><span class="si">{cn}</span><span class="s1"> &lt;&lt;==</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">cn</span><span class="o">=</span><span class="n">cn</span><span class="p">)</span>
                <span class="k">if</span> <span class="nb">type</span> <span class="o">==</span> <span class="s1">&#39;implemented_geometries&#39;</span><span class="p">:</span>
                    <span class="k">for</span> <span class="n">cg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_implemented_geometries</span><span class="p">(</span><span class="n">coordination</span><span class="o">=</span><span class="n">cn</span><span class="p">):</span>
                        <span class="k">if</span> <span class="n">additional_info</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                            <span class="k">if</span> <span class="s1">&#39;nb_hints&#39;</span> <span class="ow">in</span> <span class="n">additional_info</span><span class="p">:</span>
                                <span class="k">if</span> <span class="n">cg</span><span class="o">.</span><span class="n">neighbors_sets_hints</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                                    <span class="n">addinfo</span> <span class="o">=</span> <span class="s1">&#39; *&#39;</span>
                                <span class="k">else</span><span class="p">:</span>
                                    <span class="n">addinfo</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
                            <span class="k">else</span><span class="p">:</span>
                                <span class="n">addinfo</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
                        <span class="k">else</span><span class="p">:</span>
                            <span class="n">addinfo</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
                        <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39; - </span><span class="si">{mp}</span><span class="s1"> : </span><span class="si">{name}{addinfo}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">mp</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">,</span>
                                                                         <span class="n">name</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">get_name</span><span class="p">(),</span>
                                                                         <span class="n">addinfo</span><span class="o">=</span><span class="n">addinfo</span><span class="p">)</span>
                <span class="k">elif</span> <span class="nb">type</span> <span class="o">==</span> <span class="s1">&#39;all_geometries&#39;</span><span class="p">:</span>
                    <span class="k">for</span> <span class="n">cg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_geometries</span><span class="p">(</span><span class="n">coordination</span><span class="o">=</span><span class="n">cn</span><span class="p">):</span>
                        <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39; - </span><span class="si">{mp}</span><span class="s1"> : </span><span class="si">{name}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">mp</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">mp_symbol</span><span class="p">,</span>
                                                                <span class="n">name</span><span class="o">=</span><span class="n">cg</span><span class="o">.</span><span class="n">get_name</span><span class="p">())</span>
                <span class="n">mystring</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span>
        <span class="k">return</span> <span class="n">mystring</span></div></div>
</pre></div>

            <div class="clearer"></div>
          </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../../../index.html">pymatgen 2020.7.3 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../../index.html" >Module code</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../../../../pymatgen.html" >pymatgen</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">pymatgen.analysis.chemenv.coordination_environments.coordination_geometries</a></li> 
      </ul>
    </div>

    <div class="footer" role="contentinfo">
        &#169; Copyright 2011, Pymatgen Development Team.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.1.2.
    </div>
<div class="footer">This page uses <a href="http://analytics.google.com/">
Google Analytics</a> to collect statistics. You can disable it by blocking
the JavaScript coming from www.google-analytics.com.
<script type="text/javascript">
  (function() {
    var ga = document.createElement('script');
    ga.src = ('https:' == document.location.protocol ?
              'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    ga.setAttribute('async', 'true');
    document.documentElement.firstChild.appendChild(ga);
  })();
</script>
</div>

  </body>
</html>